Fix duplicated forward declaration for extern enums
diff --git a/gen/src/write.rs b/gen/src/write.rs
index ebef728..68b5468 100644
--- a/gen/src/write.rs
+++ b/gen/src/write.rs
@@ -31,7 +31,8 @@
fn write_forward_declarations(out: &mut OutFile, apis: &[Api]) {
let needs_forward_declaration = |api: &&Api| match api {
- Api::Struct(_) | Api::Enum(_) | Api::CxxType(_) | Api::RustType(_) => true,
+ Api::Struct(_) | Api::CxxType(_) | Api::RustType(_) => true,
+ Api::Enum(enm) => !out.types.cxx.contains(&enm.ident.rust),
_ => false,
};