Skip to content

Commit

Permalink
core: take valuable Values by value (tokio-rs#1888)
Browse files Browse the repository at this point in the history
In tokio-rs#1881, I accidentally had the `Visit` trait take a `&Value<'_>`. This
was probably wrong, since `Value` is `Copy` and should only be a couple
words, one of which might be a pointer...so it's probably better to just
pass the `pointer + enum descriminant` (or `integer + enum descriminant`)
instead of passing `pointer to (pointer + enum descriminant)`.

This probably also makes the API a little nicer.
  • Loading branch information
hawkw authored and kaffarell committed May 22, 2024
1 parent 107bd87 commit 2309bed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tracing-core/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub trait Visit {
/// [`valuable`]: https://docs.rs/valuable
#[cfg(all(tracing_unstable, feature = "valuable"))]
#[cfg_attr(docsrs, doc(cfg(all(tracing_unstable, feature = "valuable"))))]
fn record_value(&mut self, field: &Field, value: &valuable::Value<'_>) {
fn record_value(&mut self, field: &Field, value: valuable::Value<'_>) {
self.record_debug(field, &value)
}

Expand Down

0 comments on commit 2309bed

Please sign in to comment.