From 2ea43c898604930244af5f2203b11921f7deb030 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 28 Feb 2019 17:30:21 +1100 Subject: [PATCH] Don't generate code with redundant closures Fixes #1491. --- serde_derive/src/de.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serde_derive/src/de.rs b/serde_derive/src/de.rs index c43d1bb7..7be6c4b9 100644 --- a/serde_derive/src/de.rs +++ b/serde_derive/src/de.rs @@ -2476,7 +2476,7 @@ fn deserialize_map( let collected_deny_unknown_fields = if cattrs.has_flatten() && cattrs.deny_unknown_fields() { Some(quote! { - if let _serde::export::Some(_serde::export::Some((__key, _))) = __collect.into_iter().filter(|x| x.is_some()).next() { + if let _serde::export::Some(_serde::export::Some((__key, _))) = __collect.into_iter().filter(Option::is_some).next() { if let _serde::export::Some(__key) = __key.as_str() { return _serde::export::Err( _serde::de::Error::custom(format_args!("unknown field `{}`", &__key)));