We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85033bf commit 9ff37dbCopy full SHA for 9ff37db
src/encoding.rs
@@ -404,6 +404,18 @@ impl EncodeLabelValue for f64 {
404
}
405
406
407
+impl<T> EncodeLabelValue for Option<T>
408
+where
409
+ T: EncodeLabelValue,
410
+{
411
+ fn encode(&self, encoder: &mut LabelValueEncoder) -> Result<(), std::fmt::Error> {
412
+ match self {
413
+ Some(v) => EncodeLabelValue::encode(v, encoder),
414
+ None => EncodeLabelValue::encode(&"", encoder),
415
+ }
416
417
+}
418
+
419
macro_rules! impl_encode_label_value_for_integer {
420
($($t:ident),*) => {$(
421
impl EncodeLabelValue for $t {
0 commit comments