Skip to content

Commit bedae51

Browse files
committed
MSRV: Don't use matches!
1 parent 834fe6b commit bedae51

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

enumflags_derive/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ fn verify_flag_values<'a>(
111111
) -> Result<TokenStream, syn::Error> {
112112
let mut deferred_checks: Vec<TokenStream> = vec![];
113113
for variant in variants {
114-
if !matches!(variant.fields, syn::Fields::Unit) {
115-
return Err(syn::Error::new_spanned(&variant.fields,
116-
"Bitflag variants cannot contain additional data"));
114+
// I'd use matches! if not for MSRV...
115+
match variant.fields {
116+
syn::Fields::Unit => (),
117+
_ => return Err(syn::Error::new_spanned(&variant.fields,
118+
"Bitflag variants cannot contain additional data")),
117119
}
118120

119121
let discr = variant.discriminant.as_ref()

0 commit comments

Comments
 (0)