From 0112d354263bb73ebefd1980c9581cdc921ebc79 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Wed, 21 Jul 2021 08:11:19 -0700 Subject: [PATCH] refactor(error): mark TransferEncodingInvalid variant only with server feature --- src/error.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index cc601ef9..bd798667 100644 --- a/src/error.rs +++ b/src/error.rs @@ -84,7 +84,7 @@ pub(super) enum Header { Token, #[cfg(feature = "http1")] ContentLengthInvalid, - #[cfg(feature = "http1")] + #[cfg(all(feature = "http1", feature = "server"))] TransferEncodingInvalid, #[cfg(feature = "http1")] TransferEncodingUnexpected, @@ -391,7 +391,7 @@ impl Error { Kind::Parse(Parse::Header(Header::ContentLengthInvalid)) => { "invalid content-length parsed" } - #[cfg(feature = "http1")] + #[cfg(all(feature = "http1", feature = "server"))] Kind::Parse(Parse::Header(Header::TransferEncodingInvalid)) => { "invalid transfer-encoding parsed" } @@ -504,6 +504,7 @@ impl Parse { Parse::Header(Header::ContentLengthInvalid) } + #[cfg(all(feature = "http1", feature = "server"))] pub(crate) fn transfer_encoding_invalid() -> Self { Parse::Header(Header::TransferEncodingInvalid) }