From 977a5ba550827cd423fd176db745f36a55dfd670 Mon Sep 17 00:00:00 2001 From: Folyd Date: Wed, 25 Aug 2021 14:38:57 +0800 Subject: [PATCH 1/2] attributes: record `f32` and `f64` as `Value` --- tracing-attributes/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs index dac7056fea..579c4b3be3 100644 --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -878,7 +878,7 @@ enum RecordType { impl RecordType { /// Array of primitive types which should be recorded as [RecordType::Value]. - const TYPES_FOR_VALUE: [&'static str; 23] = [ + const TYPES_FOR_VALUE: [&'static str; 25] = [ "bool", "str", "u8", @@ -889,6 +889,8 @@ impl RecordType { "i32", "u64", "i64", + "f32", + "f64", "usize", "isize", "NonZeroU8", From 077208214ae2196f8c13f4c757aa0ebc4cdae3c7 Mon Sep 17 00:00:00 2001 From: Folyd Date: Thu, 26 Aug 2021 10:00:26 +0800 Subject: [PATCH 2/2] Change `TYPES_FOR_VALUE` to a slice Co-authored-by: Eliza Weisman --- tracing-attributes/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs index 579c4b3be3..d3630ffbfc 100644 --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -878,7 +878,7 @@ enum RecordType { impl RecordType { /// Array of primitive types which should be recorded as [RecordType::Value]. - const TYPES_FOR_VALUE: [&'static str; 25] = [ + const TYPES_FOR_VALUE: &'static [&'static str] = &[ "bool", "str", "u8",