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