From 9579d6a94ce3d07f30b4eb77c9d221db6ca9cddc Mon Sep 17 00:00:00 2001 From: Graham Esau Date: Sun, 8 Dec 2019 22:34:48 +0000 Subject: [PATCH] Fix rustc 1.32.0 build --- schemars_derive/src/lib.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/schemars_derive/src/lib.rs b/schemars_derive/src/lib.rs index 84409d4..a795f6a 100644 --- a/schemars_derive/src/lib.rs +++ b/schemars_derive/src/lib.rs @@ -411,13 +411,15 @@ fn get_with_from_attr(attr: &syn::Attribute) -> Option { _ => return None, }; for nm in nested_metas { - match nm { - NestedMeta::Meta(Meta::NameValue(MetaNameValue { - path, - lit: Lit::Str(with), - .. - })) if path.is_ident("with") => return Some(with), - _ => {} + if let NestedMeta::Meta(Meta::NameValue(MetaNameValue { + path, + lit: Lit::Str(with), + .. + })) = nm + { + if path.is_ident("with") { + return Some(with); + } } } None