rename FoundIn::{value -> as_str}

This commit is contained in:
Charles Hall 2024-06-04 12:24:51 -07:00
parent 22dd7f1a54
commit 38382128ac
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF

View file

@ -55,7 +55,7 @@ pub(crate) enum FoundIn {
impl FoundIn {
/// Returns a stringified representation of the current value
fn value(&self) -> &'static str {
fn as_str(&self) -> &'static str {
match self {
FoundIn::Cache => "hit",
FoundIn::Database => "miss-database",
@ -67,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) {
tracing::Span::current().record(field, self.value());
tracing::Span::current().record(field, self.as_str());
}
}