From b90a1d83f2f84d2a644d9d45a2ab2a644cde12d5 Mon Sep 17 00:00:00 2001 From: koushiro Date: Sun, 10 Nov 2024 21:13:00 +0800 Subject: [PATCH] feat(encoding): impl EncodeLabelValue for bool Signed-off-by: koushiro --- src/encoding.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/encoding.rs b/src/encoding.rs index 2be2d37..564e6c5 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -537,6 +537,12 @@ where } } +impl EncodeLabelValue for bool { + fn encode(&self, encoder: &mut LabelValueEncoder) -> Result<(), std::fmt::Error> { + encoder.write_str(if *self { "true" } else { "false" }) + } +} + macro_rules! impl_encode_label_value_for_integer { ($($t:ident),*) => {$( impl EncodeLabelValue for $t {