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()) } }