diff --git a/src/client.rs b/src/client.rs index dc0f935..35ad063 100644 --- a/src/client.rs +++ b/src/client.rs @@ -16,7 +16,7 @@ impl Client { Ok(Self { socket }) } - pub async fn send<'a>(&self, metric: Metric<'a>) -> Result<(), Error> { + pub async fn send(&self, metric: Metric<'_>) -> Result<(), Error> { let bytes = metric.into_bytes(); self.socket.send(&bytes).await?; Ok(()) diff --git a/src/metric.rs b/src/metric.rs index 81d6949..4987f04 100644 --- a/src/metric.rs +++ b/src/metric.rs @@ -116,7 +116,7 @@ impl<'a> Metric<'a> { } while next_tag.is_some() { - let tag = next_tag.unwrap().into(); + let tag = next_tag.unwrap(); match tag { Tag::Single(value) => { buf.extend_from_slice(value.as_bytes()); diff --git a/src/tag.rs b/src/tag.rs index 8f52a12..708e5f9 100644 --- a/src/tag.rs +++ b/src/tag.rs @@ -17,9 +17,9 @@ impl<'a> From<(&'a str, &'a str)> for Tag<'a> { } } -impl<'a> Into> for Tag<'a> { - fn into(self) -> Cow<'a, str> { - match self { +impl<'a> From> for Cow<'a, str> { + fn from(tag: Tag<'a>) -> Cow<'a, str> { + match tag { Tag::Single(single) => single, Tag::KeyValue(key, value) => { let mut out = key.to_string();