From bba96961d3c496cab5afd076335415929c1dc45c Mon Sep 17 00:00:00 2001 From: Kushagra Udai Date: Wed, 20 Nov 2024 11:25:08 -0800 Subject: [PATCH] More --- src/metrics.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/metrics.rs b/src/metrics.rs index 1a6e377..fa599d7 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -104,6 +104,7 @@ pub enum HttpMethod { } impl HttpMethod { + #[cfg(feature = "metrics")] fn as_str(&self) -> &'static str { match self { HttpMethod::Options => "options", @@ -120,6 +121,7 @@ impl HttpMethod { } } +#[cfg(feature = "metrics")] impl From for HttpMethod { fn from(method: http::Method) -> Self { match method { @@ -160,6 +162,7 @@ pub enum Function { impl Function { /// Get the function as a string. + #[cfg(feature = "metrics")] pub fn as_str(&self) -> &'static str { match self { Function::ReadKey => "read_key",