Skip to content

Commit

Permalink
chore: make clippy happy (#10)
Browse files Browse the repository at this point in the history
* chore: clippy

* chore: update latest solc
  • Loading branch information
Evalir authored Oct 31, 2023
1 parent 7b63c75 commit 8d79348
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/artifact_output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ impl<T> Artifacts<T> {
pub fn find_first(&self, contract_name: impl AsRef<str>) -> Option<&T> {
let contract_name = contract_name.as_ref();
self.0.iter().find_map(|(_file, contracts)| {
contracts.get(contract_name).and_then(|c| c.get(0).map(|a| &a.artifact))
contracts.get(contract_name).and_then(|c| c.first().map(|a| &a.artifact))
})
}

Expand All @@ -378,7 +378,7 @@ impl<T> Artifacts<T> {
let contract_name = contract.as_ref();
self.0.iter().filter(|(path, _)| path.as_str() == contract_path).find_map(
|(_file, contracts)| {
contracts.get(contract_name).and_then(|c| c.get(0).map(|a| &a.artifact))
contracts.get(contract_name).and_then(|c| c.first().map(|a| &a.artifact))
},
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ mod tests {
(">=0.4.0 <0.5.0", "0.4.26"),
// latest - this has to be updated every time a new version is released.
// Requires the SVM version list to be updated as well.
(">=0.5.0", "0.8.21"),
(">=0.5.0", "0.8.22"),
] {
let source = source(pragma);
let res = Solc::detect_version(&source).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/compile/output/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl VersionedContracts {
self.0
.get(path.as_ref())
.and_then(|contracts| {
contracts.get(contract).and_then(|c| c.get(0).map(|c| &c.contract))
contracts.get(contract).and_then(|c| c.first().map(|c| &c.contract))
})
.map(CompactContractRef::from)
}
Expand Down
2 changes: 1 addition & 1 deletion src/project_util/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl MockProjectGenerator {
// stores libs and their files
let libs = get_libs(
&edges,
&paths.libraries.get(0).cloned().unwrap_or_else(|| paths.root.join("lib")),
&paths.libraries.first().cloned().unwrap_or_else(|| paths.root.join("lib")),
)
.ok_or_else(|| SolcError::msg("Failed to detect libs"))?;

Expand Down
2 changes: 1 addition & 1 deletion src/project_util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl<T: ArtifactOutput> TempProject<T> {
fn get_lib(&self) -> Result<PathBuf> {
self.paths()
.libraries
.get(0)
.first()
.cloned()
.ok_or_else(|| SolcError::msg("No libraries folders configured"))
}
Expand Down

0 comments on commit 8d79348

Please sign in to comment.