Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
kushudai committed Nov 20, 2024
1 parent 6551555 commit bba9696
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub enum HttpMethod {
}

impl HttpMethod {
#[cfg(feature = "metrics")]
fn as_str(&self) -> &'static str {
match self {
HttpMethod::Options => "options",
Expand All @@ -120,6 +121,7 @@ impl HttpMethod {
}
}

#[cfg(feature = "metrics")]
impl From<http::Method> for HttpMethod {
fn from(method: http::Method) -> Self {
match method {
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit bba9696

Please sign in to comment.