Skip to content

Commit da80d2a

Browse files
authored
test(lib): fix unused warnings due to feature gating test imports (#3997)
1 parent 1c70fab commit da80d2a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/body/incoming.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,16 @@ impl fmt::Debug for Sender {
458458

459459
#[cfg(test)]
460460
mod tests {
461+
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
461462
use std::mem;
463+
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
462464
use std::task::Poll;
463465

466+
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
464467
use super::{Body, Incoming, SizeHint};
465468
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
466469
use super::{DecodedLength, Sender};
470+
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
467471
use http_body_util::BodyExt;
468472

469473
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]

src/common/io/rewind.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ pub(crate) struct Rewind<T> {
1414
}
1515

1616
impl<T> Rewind<T> {
17-
#[cfg(test)]
17+
#[cfg(all(
18+
test,
19+
any(feature = "client", feature = "server"),
20+
any(feature = "http1", feature = "http2")
21+
))]
1822
pub(crate) fn new(io: T) -> Self {
1923
Rewind {
2024
pre: None,
@@ -29,7 +33,11 @@ impl<T> Rewind<T> {
2933
}
3034
}
3135

32-
#[cfg(test)]
36+
#[cfg(all(
37+
test,
38+
any(feature = "client", feature = "server"),
39+
any(feature = "http1", feature = "http2")
40+
))]
3341
pub(crate) fn rewind(&mut self, bs: Bytes) {
3442
debug_assert!(self.pre.is_none());
3543
self.pre = Some(bs);

0 commit comments

Comments
 (0)