diff options
author | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-03-25 16:39:25 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-03-25 16:39:25 +0100 |
commit | 53a791bf6836e5094c5128692f4f7422fac08139 (patch) | |
tree | c9c17998e0da77bab912c453e6a27ac3bd6552cf | |
parent | 072fef6ac6d61d7b4c99d0ebdd9af38420906608 (diff) |
gen: Fix anon enums and silence unused mut warning
-rw-r--r-- | src/gen.rs | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -973,6 +973,7 @@ fn cstruct_to_rs(ctx: &mut GenCtx, name: &str, ci: CompInfo) -> Vec<P<ast::Item> let empty_name = ei.borrow().name.is_empty(); if empty_name { ei.borrow_mut().name = format!("{}_enum{}", name, anon_enum_count); + anon_enum_count += 1; } else { // Mangled name to deal with multiple definitions of the same inner type let new_name = [name, &*ei.borrow().name].join("_").to_owned(); @@ -1088,7 +1089,7 @@ fn cstruct_to_rs(ctx: &mut GenCtx, name: &str, ci: CompInfo) -> Vec<P<ast::Item> } } - if let Some(mut rc_c) = opt_rc_c { + if let Some(rc_c) = opt_rc_c { let name_is_empty = rc_c.borrow().name.is_empty(); if name_is_empty { |