From 07f920871454479a4c21301c51630e073aafdefb Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sun, 29 Aug 2021 14:48:37 +0200 Subject: [PATCH] refactor(lib): Inline cfg_http1, cfg_http2 macros --- src/cfg.rs | 18 ------------------ src/proto/mod.rs | 9 +++++---- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/cfg.rs b/src/cfg.rs index 1533951b..71a5351d 100644 --- a/src/cfg.rs +++ b/src/cfg.rs @@ -24,24 +24,6 @@ macro_rules! cfg_proto { } cfg_proto! { - macro_rules! cfg_http1 { - ($($item:item)*) => { - cfg_feature! { - #![feature = "http1"] - $($item)* - } - } - } - - macro_rules! cfg_http2 { - ($($item:item)*) => { - cfg_feature! { - #![feature = "http2"] - $($item)* - } - } - } - macro_rules! cfg_client { ($($item:item)*) => { cfg_feature! { diff --git a/src/proto/mod.rs b/src/proto/mod.rs index 513b70f8..f938bf53 100644 --- a/src/proto/mod.rs +++ b/src/proto/mod.rs @@ -1,6 +1,8 @@ //! Pieces pertaining to the HTTP message protocol. -cfg_http1! { +cfg_feature! { + #![feature = "http1"] + pub(crate) mod h1; pub(crate) use self::h1::Conn; @@ -11,9 +13,8 @@ cfg_http1! { pub(crate) use self::h1::ServerTransaction; } -cfg_http2! { - pub(crate) mod h2; -} +#[cfg(feature = "http2")] +pub(crate) mod h2; /// An Incoming Message head. Includes request/status line, and headers. #[derive(Debug, Default)]