Skip to content

Commit

Permalink
feat(encoding): impl EncodeLabelValue for bool
Browse files Browse the repository at this point in the history
Signed-off-by: koushiro <[email protected]>
  • Loading branch information
koushiro committed Nov 10, 2024
1 parent 1e6e9ac commit b90a1d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b90a1d8

Please sign in to comment.