From fa280a415333e40dd4e02f2b3e0c7d54569ab2e5 Mon Sep 17 00:00:00 2001 From: muxi Date: Thu, 19 Dec 2024 21:19:54 +0800 Subject: [PATCH] fix: resolve clippy warning Signed-off-by: muxi --- ylong_http_client/src/async_impl/request.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ylong_http_client/src/async_impl/request.rs b/ylong_http_client/src/async_impl/request.rs index 3837647..79eeb59 100644 --- a/ylong_http_client/src/async_impl/request.rs +++ b/ylong_http_client/src/async_impl/request.rs @@ -350,6 +350,7 @@ impl Body { Self { inner } } + #[cfg(feature = "http2")] pub(crate) fn is_empty(&self) -> bool { matches!(self.inner, BodyKind::Empty) } @@ -451,6 +452,7 @@ mod ut_client_request { let builder = RequestBuilder::default().append_header("name", "value"); let request = builder.body(Body::empty()); assert!(request.is_ok()); + #[cfg(feature = "http2")] assert!(request.unwrap().body().is_empty()); let request = RequestBuilder::default() -- Gitee