Skip to content

Commit

Permalink
Use struct update syntax for ItemStruct
Browse files Browse the repository at this point in the history
Co-authored-by: pickx <[email protected]>
  • Loading branch information
kitlith and pickx authored Sep 12, 2023
1 parent c3cc057 commit 62441df
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bilge-impl/src/bitsize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ fn generate_struct(item: &ItemStruct, declared_bitsize: u8) -> TokenStream {
quote!(#acc + #field_size)
});

// The only part of the struct we don't want to pass through are the attributes
let mut item = item.clone();
item.attrs = Vec::new();
let item = ItemStruct {
attrs: Vec::new(),
..item.clone()
};

let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();

Expand Down

0 comments on commit 62441df

Please sign in to comment.