Skip to content

Commit

Permalink
refactor(lib): fix some unused warnings (#3657)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed May 3, 2024
1 parent 721785e commit 39b88d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/body/incoming.rs
Expand Up @@ -317,6 +317,13 @@ impl Body for Incoming {

impl fmt::Debug for Incoming {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
#[cfg(any(
all(
any(feature = "http1", feature = "http2"),
any(feature = "client", feature = "server")
),
feature = "ffi"
))]
#[derive(Debug)]
struct Streaming;
#[derive(Debug)]
Expand Down
4 changes: 4 additions & 0 deletions src/body/mod.rs
Expand Up @@ -35,6 +35,10 @@ pub(crate) use self::incoming::Sender;
pub(crate) use self::length::DecodedLength;

mod incoming;
#[cfg(all(
any(feature = "http1", feature = "http2"),
any(feature = "client", feature = "server")
))]
mod length;

fn _assert_send_sync() {
Expand Down
1 change: 1 addition & 0 deletions src/error.rs
Expand Up @@ -98,6 +98,7 @@ pub(super) enum Parse {
#[cfg(feature = "http1")]
Header(Header),
#[cfg(any(feature = "http1", feature = "http2"))]
#[cfg_attr(feature = "http2", allow(unused))]
TooLarge,
Status,
#[cfg(all(any(feature = "client", feature = "server"), feature = "http1"))]
Expand Down
6 changes: 4 additions & 2 deletions src/proto/h1/role.rs
@@ -1,7 +1,7 @@
use std::{fmt, mem::MaybeUninit};
use std::mem::MaybeUninit;

#[cfg(feature = "client")]
use std::fmt::Write;
use std::fmt::{self, Write as _};
#[cfg(feature = "server")]
use std::time::Instant;

Expand Down Expand Up @@ -1605,8 +1605,10 @@ fn write_headers_original_case(
}
}

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

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

0 comments on commit 39b88d5

Please sign in to comment.