diff --git a/autogen/Cargo.toml b/autogen/Cargo.toml index 43c85fd..10a0174 100644 --- a/autogen/Cargo.toml +++ b/autogen/Cargo.toml @@ -6,7 +6,6 @@ authors = [ "Lei Zhang ", ] edition = "2018" -rust-version = "1.58" publish = false diff --git a/autogen/src/dr.rs b/autogen/src/dr.rs index bc5b412..90ecbd2 100644 --- a/autogen/src/dr.rs +++ b/autogen/src/dr.rs @@ -391,7 +391,7 @@ pub fn gen_dr_operand_kinds(grammar: &[structs::OperandKind]) -> TokenStream { let mut seen_discriminator = BTreeMap::new(); for e in enumerators { - if seen_discriminator.get(&e.value).is_none() { + if let std::collections::btree_map::Entry::Vacant(seen_entry) = seen_discriminator.entry(e.value) { let name = match category { structs::Category::BitEnum => { use heck::ShoutySnakeCase; @@ -412,7 +412,7 @@ pub fn gen_dr_operand_kinds(grammar: &[structs::OperandKind]) -> TokenStream { _ => panic!("Unexpected operand type"), }; - seen_discriminator.insert(e.value, name.clone()); + seen_entry.insert(name.clone()); capability_clauses .entry(&e.capabilities)