Skip to content

Commit

Permalink
tests: Use let-else more
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Oct 30, 2023
1 parent f932302 commit 09a935a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/auxiliary/macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ pub fn remove_attr(args: TokenStream, input: TokenStream) -> TokenStream {
let mut item: ItemStruct = syn::parse_macro_input!(input);
match &*args.to_string() {
"field_all" => {
if let Fields::Named(fields) = &mut item.fields { fields } else { unreachable!() }
.named
.iter_mut()
.for_each(|field| field.attrs.clear());
let Fields::Named(fields) = &mut item.fields else { unreachable!() };
fields.named.iter_mut().for_each(|field| field.attrs.clear());
}
"struct_all" => item.attrs.clear(),
"struct_pin" => {
Expand Down

0 comments on commit 09a935a

Please sign in to comment.