From 68069d734a61c5ca4aed9cd5122f0020aa033677 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 5 May 2022 21:07:15 -0700 Subject: [PATCH] Fix needless_borrow for both value=Cow and value=&str --- 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 b7750cec..6033f966 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)) } } }