diff --git a/ethers-contract/ethers-contract-abigen/src/multi.rs b/ethers-contract/ethers-contract-abigen/src/multi.rs index f0dab653..92e10fce 100644 --- a/ethers-contract/ethers-contract-abigen/src/multi.rs +++ b/ethers-contract/ethers-contract-abigen/src/multi.rs @@ -575,9 +575,11 @@ impl MultiBindingsInner { let data = std::fs::read_to_string(cargo_dir)?; let toml = data.parse::()?; - let Some(ethers) = toml.get("dependencies") - .and_then (|v| v.get("ethers").or_else(|| v.get("ethers-contract"))) - else { eyre::bail!("couldn't find ethers or ethers-contract dependency")}; + let ethers = toml + .get("dependencies") + .and_then(|v| v.get("ethers").or_else(|| v.get("ethers-contract"))) + .ok_or_else(|| eyre::eyre!("couldn't find ethers or ethers-contract dependency"))?; + if let Some(rev) = ethers.get("rev") { Ok(format!("ethers = {{ git = \"https://github.com/gakonst/ethers-rs\", rev = {}, default-features = false, features = [\"abigen\"] }}", rev)) } else if let Some(version) = ethers.get("version") {