diff --git a/src/observability.rs b/src/observability.rs index 054ee7a9..4e4cec0a 100644 --- a/src/observability.rs +++ b/src/observability.rs @@ -41,6 +41,7 @@ impl Drop for Guard { } /// Type to record cache performance in a tracing span field. +#[derive(Clone, Copy)] pub(crate) enum FoundIn { /// Found in cache Cache, @@ -55,7 +56,7 @@ pub(crate) enum FoundIn { impl FoundIn { /// Returns a stringified representation of the current value - fn as_str(&self) -> &'static str { + fn as_str(self) -> &'static str { match self { FoundIn::Cache => "Cache", FoundIn::Database => "Database", @@ -66,7 +67,7 @@ impl FoundIn { /// Record the current value to the current [`tracing::Span`] // TODO: use tracing::Value instead if it ever becomes accessible - pub(crate) fn record(&self, field: &str) { + pub(crate) fn record(self, field: &str) { tracing::Span::current().record(field, self.as_str()); } }