diff --git a/ethers-solc/src/compile/output/mod.rs b/ethers-solc/src/compile/output/mod.rs index bddb0890..72370704 100644 --- a/ethers-solc/src/compile/output/mod.rs +++ b/ethers-solc/src/compile/output/mod.rs @@ -204,12 +204,12 @@ impl ProjectCompileOutput { pub fn compiled_contracts_by_compiler_version( &self, ) -> BTreeMap> { - let mut contracts = BTreeMap::new(); + let mut contracts: BTreeMap<_, Vec<_>> = BTreeMap::new(); let versioned_contracts = &self.compiler_output.contracts; for (_, name, contract, version) in versioned_contracts.contracts_with_files_and_version() { contracts .entry(version.to_owned()) - .or_insert(Vec::<(String, Contract)>::new()) + .or_default() .push((name.to_string(), contract.clone())); } contracts