Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Apr 8, 2024
1 parent a59a7ab commit b17a4c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion crates/cli/src/utils/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn remove_contract(
} else {
let mut err = format!("could not find artifact: `{}`", name);
if let Some(suggestion) =
super::did_you_mean(&name, output.artifacts().map(|(name, _)| name)).pop()
super::did_you_mean(name, output.artifacts().map(|(name, _)| name)).pop()
{
if suggestion != name {
err = format!(
Expand Down
21 changes: 9 additions & 12 deletions crates/common/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,21 +470,18 @@ pub fn find_contract_path(target_name: &str, project: &Project) -> Result<PathBu
.map_err(|_| eyre::eyre!("Failed to parse {}.", file.display()))?;

for part in parsed.0 {
match part {
SourceUnitPart::ContractDefinition(contract) => {
if let Some(name) = contract.name {
if name.name == target_name {
if target.is_some() {
eyre::bail!(
"Found multiple matching contracts with the name `{}`",
target_name
);
}
target = Some(file);
if let SourceUnitPart::ContractDefinition(contract) = part {
if let Some(name) = contract.name {
if name.name == target_name {
if target.is_some() {
eyre::bail!(
"Found multiple matching contracts with the name `{}`",
target_name
);
}
target = Some(file);
}
}
_ => {}
}
}
}
Expand Down

0 comments on commit b17a4c6

Please sign in to comment.