From 5b32217877dad68cac34be9708ebb224626cce0b Mon Sep 17 00:00:00 2001 From: tyranron Date: Fri, 29 Oct 2021 14:13:26 +0300 Subject: [PATCH] Fix `unused_results` complaining rustc lint in codegen for adjacently tagged enum --- serde/src/private/mod.rs | 1 + serde_derive/src/de.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/serde/src/private/mod.rs b/serde/src/private/mod.rs index 71e82a899..ef26021e4 100644 --- a/serde/src/private/mod.rs +++ b/serde/src/private/mod.rs @@ -13,6 +13,7 @@ pub use lib::convert::{From, Into}; pub use lib::default::Default; pub use lib::fmt::{self, Formatter}; pub use lib::marker::PhantomData; +pub use lib::mem; pub use lib::option::Option::{self, None, Some}; pub use lib::ptr; pub use lib::result::Result::{self, Err, Ok}; diff --git a/serde_derive/src/de.rs b/serde_derive/src/de.rs index 7f4d7c441..1785d76a2 100644 --- a/serde_derive/src/de.rs +++ b/serde_derive/src/de.rs @@ -1458,7 +1458,7 @@ fn deserialize_adjacently_tagged_enum( while let _serde::__private::Some(__k) = #next_key { match __k { _serde::__private::de::TagContentOtherField::Other => { - try!(_serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map)); + _serde::__private::mem::drop(try!(_serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map))); continue; }, _serde::__private::de::TagContentOtherField::Tag => {