mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Fix several clippy warnings in components/hyper_serde (#31508)
This commit is contained in:
parent
24a088d94c
commit
3a3e76a935
1 changed files with 4 additions and 4 deletions
|
@ -138,7 +138,7 @@ impl<T> De<T> {
|
||||||
/// Returns a new `De` wrapper
|
/// Returns a new `De` wrapper
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn new(v: T) -> Self {
|
pub fn new(v: T) -> Self {
|
||||||
De { v: v }
|
De { v }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ impl<'de> Deserialize<'de> for De<HeaderMap> {
|
||||||
for v in values.0.iter() {
|
for v in values.0.iter() {
|
||||||
headers.append(
|
headers.append(
|
||||||
HeaderName::from_str(&k).map_err(V::Error::custom)?,
|
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(
|
&Value(
|
||||||
&values
|
&values
|
||||||
.iter()
|
.iter()
|
||||||
.map(|v| v.as_bytes().iter().cloned().collect())
|
.map(|v| v.as_bytes().to_vec())
|
||||||
.collect::<Vec<Vec<u8>>>(),
|
.collect::<Vec<Vec<u8>>>(),
|
||||||
self.pretty,
|
self.pretty,
|
||||||
),
|
),
|
||||||
|
@ -531,7 +531,7 @@ impl<'a> Serialize for Ser<'a, Mime> {
|
||||||
where
|
where
|
||||||
S: Serializer,
|
S: Serializer,
|
||||||
{
|
{
|
||||||
serializer.serialize_str(&self.v.to_string())
|
serializer.serialize_str(&self.v.as_ref())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue