diff --git a/crates/compilers/Cargo.toml b/crates/compilers/Cargo.toml index 0716c8215..e0fd8a685 100644 --- a/crates/compilers/Cargo.toml +++ b/crates/compilers/Cargo.toml @@ -37,7 +37,7 @@ futures-util = { workspace = true, optional = true } tokio = { workspace = true, optional = true } auto_impl = "1" -winnow = "0.6" +winnow = "0.7" dyn-clone = "1" derive_more = { version = "1", features = ["debug"] } home = "0.5" diff --git a/crates/compilers/src/compilers/solc/mod.rs b/crates/compilers/src/compilers/solc/mod.rs index 5b4756aaf..3c1d6526a 100644 --- a/crates/compilers/src/compilers/solc/mod.rs +++ b/crates/compilers/src/compilers/solc/mod.rs @@ -342,8 +342,8 @@ impl CompilerSettings for SolcSettings { let SolcRestrictions { evm_version, via_ir, optimizer_runs, bytecode_hash } = restrictions; satisfies &= evm_version.satisfies(self.evm_version); - satisfies &= via_ir.map_or(true, |via_ir| via_ir == self.via_ir.unwrap_or_default()); - satisfies &= bytecode_hash.map_or(true, |bytecode_hash| { + satisfies &= via_ir.is_none_or(|via_ir| via_ir == self.via_ir.unwrap_or_default()); + satisfies &= bytecode_hash.is_none_or(|bytecode_hash| { self.metadata.as_ref().and_then(|m| m.bytecode_hash) == Some(bytecode_hash) }); satisfies &= optimizer_runs.satisfies(self.optimizer.runs); diff --git a/crates/compilers/src/lib.rs b/crates/compilers/src/lib.rs index 45361b1a7..cdda3e9b8 100644 --- a/crates/compilers/src/lib.rs +++ b/crates/compilers/src/lib.rs @@ -866,10 +866,10 @@ fn rebase_path(base: &Path, path: &Path) -> PathBuf { if Some(path_component) != base_component { if base_component.is_some() { - new_path.extend( - std::iter::repeat(std::path::Component::ParentDir) - .take(base_components.count() + 1), - ); + new_path.extend(std::iter::repeat_n( + std::path::Component::ParentDir, + base_components.count() + 1, + )); } new_path.push(path_component);