fix(abigen): make compatible with older rust versions (#1868)
* fix(abigen): make compatible with older rust versions * Update ethers-contract/ethers-contract-abigen/src/multi.rs Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> * fix: linting Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
parent
0e51835a33
commit
a525659f5d
|
@ -575,9 +575,11 @@ impl MultiBindingsInner {
|
||||||
let data = std::fs::read_to_string(cargo_dir)?;
|
let data = std::fs::read_to_string(cargo_dir)?;
|
||||||
let toml = data.parse::<Value>()?;
|
let toml = data.parse::<Value>()?;
|
||||||
|
|
||||||
let Some(ethers) = toml.get("dependencies")
|
let ethers = toml
|
||||||
.and_then (|v| v.get("ethers").or_else(|| v.get("ethers-contract")))
|
.get("dependencies")
|
||||||
else { eyre::bail!("couldn't find ethers or ethers-contract dependency")};
|
.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") {
|
if let Some(rev) = ethers.get("rev") {
|
||||||
Ok(format!("ethers = {{ git = \"https://github.com/gakonst/ethers-rs\", rev = {}, default-features = false, features = [\"abigen\"] }}", 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") {
|
} else if let Some(version) = ethers.get("version") {
|
||||||
|
|
Loading…
Reference in New Issue