fix clippy lints in generated code

This commit is contained in:
Jacob Lifshay 2024-10-07 21:59:50 -07:00
parent 017c14a2f1
commit 99180eb3b4
Signed by: programmerjake
SSH key fingerprint: SHA256:B1iRVvUJkvd7upMIiMqn6OyxvD2SgJkAH3ZnUOj6z+c
3 changed files with 13 additions and 3 deletions

View file

@ -584,7 +584,7 @@ impl ToTokens for ParsedBundle {
|((index, field), flip)| {
let ident: &Ident = field.ident().as_ref().unwrap();
let ident_str = ident.to_string();
let flipped = flip.is_some();
let not_flipped = flip.is_none().then(|| Token![!](span));
quote_spanned! {span=>
#ident: {
let ::fayalite::bundle::BundleField {
@ -593,7 +593,7 @@ impl ToTokens for ParsedBundle {
ty: __ty,
} = #fields_token[#index];
::fayalite::__std::assert_eq!(&*__name, #ident_str);
::fayalite::__std::assert_eq!(__flipped, #flipped);
::fayalite::__std::assert!(#not_flipped __flipped);
::fayalite::ty::Type::from_canonical(__ty)
},
}