Fix needless_borrow for both value=Cow<str> and value=&str

This commit is contained in:
David Tolnay 2022-05-05 21:07:15 -07:00
parent dc84693507
commit 68069d734a
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -2012,7 +2012,7 @@ impl<'de> Deserialize<'de> for Duration {
b"nanos" => Ok(Field::Nanos),
_ => {
let value = ::__private::from_utf8_lossy(value);
Err(Error::unknown_field(value, FIELDS))
Err(Error::unknown_field(&*value, FIELDS))
}
}
}
@ -2352,7 +2352,7 @@ mod range {
b"end" => Ok(Field::End),
_ => {
let value = ::__private::from_utf8_lossy(value);
Err(Error::unknown_field(value, FIELDS))
Err(Error::unknown_field(&*value, FIELDS))
}
}
}