Skip to content

Commit

Permalink
feat: allow Arc<String> on EncodeLabelSet
Browse files Browse the repository at this point in the history
Signed-off-by: Yazhou <[email protected]>
  • Loading branch information
flaneur2020 committed Jul 18, 2024
1 parent aeca8d8 commit fa62e27
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,19 @@ impl EncodeLabelValue for &str {
Ok(())
}
}

impl EncodeLabelValue for String {
fn encode(&self, encoder: &mut LabelValueEncoder) -> Result<(), std::fmt::Error> {
EncodeLabelValue::encode(&self.as_str(), encoder)
}
}

impl EncodeLabelValue for &String {
fn encode(&self, encoder: &mut LabelValueEncoder) -> Result<(), std::fmt::Error> {
EncodeLabelValue::encode(&self.as_str(), encoder)
}
}

impl<'a> EncodeLabelValue for Cow<'a, str> {
fn encode(&self, encoder: &mut LabelValueEncoder) -> Result<(), std::fmt::Error> {
EncodeLabelValue::encode(&self.as_ref(), encoder)
Expand Down

0 comments on commit fa62e27

Please sign in to comment.