From dc846935075aea06d087723ddf2db9d0cf72246a Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 5 May 2022 21:00:57 -0700 Subject: [PATCH] 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 --- serde/src/de/impls.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index c5aaca72..b7750cec 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -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)) } } }