Fix previous commit.
diff --git a/macro/src/expand.rs b/macro/src/expand.rs
index 1a23960..d8810dc 100644
--- a/macro/src/expand.rs
+++ b/macro/src/expand.rs
@@ -7,7 +7,6 @@
};
use proc_macro2::{Ident, Span, TokenStream};
use quote::{format_ident, quote, quote_spanned, ToTokens};
-use std::collections::HashSet;
use syn::{parse_quote, Error, ItemMod, Result, Token};
pub fn bridge(namespace: &Namespace, mut ffi: ItemMod) -> Result<TokenStream> {
@@ -40,19 +39,13 @@
}
}
- let mut enums = HashSet::new();
- for api in apis {
- if let Api::Enum(enm) = api {
- enums.insert(&enm.ident);
- }
- }
for api in apis {
match api {
Api::Include(_) | Api::RustType(_) => {}
Api::Struct(strct) => expanded.extend(expand_struct(strct)),
Api::Enum(enm) => expanded.extend(expand_enum(enm)),
Api::CxxType(ety) => {
- if !enums.contains(&ety.ident) {
+ if !types.enums.contains_key(&ety.ident) {
expanded.extend(expand_cxx_type(ety));
}
}