Resolve needless_borrow clippy lint

error: this expression creates a reference which is immediately dereferenced by the compiler
        --> serde/src/de/impls.rs:2015:58
         |
    2015 | ...                   Err(Error::unknown_field(&value, FIELDS))
         |                                                ^^^^^^ help: change this to: `value`
         |
         = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression creates a reference which is immediately dereferenced by the compiler
        --> serde/src/de/impls.rs:2355:54
         |
    2355 | ...                   Err(Error::unknown_field(&value, FIELDS))
         |                                                ^^^^^^ help: change this to: `value`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
This commit is contained in:
David Tolnay 2022-05-05 21:00:57 -07:00
parent 4cf012c5be
commit dc84693507
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), b"nanos" => Ok(Field::Nanos),
_ => { _ => {
let value = ::__private::from_utf8_lossy(value); 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), b"end" => Ok(Field::End),
_ => { _ => {
let value = ::__private::from_utf8_lossy(value); let value = ::__private::from_utf8_lossy(value);
Err(Error::unknown_field(&value, FIELDS)) Err(Error::unknown_field(value, FIELDS))
} }
} }
} }