Skip to content

Commit

Permalink
Fixed the generation of associated constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Klimov committed Feb 17, 2025
1 parent d3252cf commit 740f41c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bindgen/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,12 @@ impl Parse {
}
syn::Item::Impl(ref item_impl) => {
let mut impls_with_assoc_ty = Vec::new();
let mut assoc_const_find = false;

item_impl.items.iter().for_each(|item| {
if matches!(item, syn::ImplItem::Const(_)) {
if matches!(item, syn::ImplItem::Const(_)) && !assoc_const_find {
impls_with_assoc_consts.push(item_impl);
assoc_const_find = !assoc_const_find;
} else if let syn::ImplItem::Type(t) = item {
impls_with_assoc_ty.push((&t.ident, &t.ty));
}
Expand Down

0 comments on commit 740f41c

Please sign in to comment.