Skip to content

Commit 39b88d5

Browse files
authored
refactor(lib): fix some unused warnings (#3657)
1 parent 721785e commit 39b88d5

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

src/body/incoming.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,13 @@ impl Body for Incoming {
317317

318318
impl fmt::Debug for Incoming {
319319
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
320+
#[cfg(any(
321+
all(
322+
any(feature = "http1", feature = "http2"),
323+
any(feature = "client", feature = "server")
324+
),
325+
feature = "ffi"
326+
))]
320327
#[derive(Debug)]
321328
struct Streaming;
322329
#[derive(Debug)]

src/body/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ pub(crate) use self::incoming::Sender;
3535
pub(crate) use self::length::DecodedLength;
3636

3737
mod incoming;
38+
#[cfg(all(
39+
any(feature = "http1", feature = "http2"),
40+
any(feature = "client", feature = "server")
41+
))]
3842
mod length;
3943

4044
fn _assert_send_sync() {

src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ pub(super) enum Parse {
9898
#[cfg(feature = "http1")]
9999
Header(Header),
100100
#[cfg(any(feature = "http1", feature = "http2"))]
101+
#[cfg_attr(feature = "http2", allow(unused))]
101102
TooLarge,
102103
Status,
103104
#[cfg(all(any(feature = "client", feature = "server"), feature = "http1"))]

src/proto/h1/role.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use std::{fmt, mem::MaybeUninit};
1+
use std::mem::MaybeUninit;
22

33
#[cfg(feature = "client")]
4-
use std::fmt::Write;
4+
use std::fmt::{self, Write as _};
55
#[cfg(feature = "server")]
66
use std::time::Instant;
77

@@ -1605,8 +1605,10 @@ fn write_headers_original_case(
16051605
}
16061606
}
16071607

1608+
#[cfg(feature = "client")]
16081609
struct FastWrite<'a>(&'a mut Vec<u8>);
16091610

1611+
#[cfg(feature = "client")]
16101612
impl<'a> fmt::Write for FastWrite<'a> {
16111613
#[inline]
16121614
fn write_str(&mut self, s: &str) -> fmt::Result {

0 commit comments

Comments
 (0)