From 3a3e76a935f92ce84c24496cfc46207cd46088f6 Mon Sep 17 00:00:00 2001 From: Mucha Naibei Date: Wed, 6 Mar 2024 11:14:23 +0300 Subject: [PATCH] Fix several clippy warnings in components/hyper_serde (#31508) --- components/hyper_serde/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/hyper_serde/lib.rs b/components/hyper_serde/lib.rs index 4df1983ea7a..22f79c8ad65 100644 --- a/components/hyper_serde/lib.rs +++ b/components/hyper_serde/lib.rs @@ -138,7 +138,7 @@ impl De { /// Returns a new `De` wrapper #[inline(always)] pub fn new(v: T) -> Self { - De { v: v } + De { v } } } @@ -366,7 +366,7 @@ impl<'de> Deserialize<'de> for De { for v in values.0.iter() { headers.append( HeaderName::from_str(&k).map_err(V::Error::custom)?, - HeaderValue::from_bytes(&v).map_err(V::Error::custom)?, + HeaderValue::from_bytes(v).map_err(V::Error::custom)?, ); } } @@ -453,7 +453,7 @@ impl<'a> Serialize for Ser<'a, HeaderMap> { &Value( &values .iter() - .map(|v| v.as_bytes().iter().cloned().collect()) + .map(|v| v.as_bytes().to_vec()) .collect::>>(), self.pretty, ), @@ -531,7 +531,7 @@ impl<'a> Serialize for Ser<'a, Mime> { where S: Serializer, { - serializer.serialize_str(&self.v.to_string()) + serializer.serialize_str(&self.v.as_ref()) } }