Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

chore(clippy): make clippy happy #2647

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ethers-etherscan/tests/it/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async fn get_erc20_transfer_events_success() {
)
.await
.unwrap();
let tx = txs.get(0).unwrap();
let tx = txs.first().unwrap();
assert_eq!(tx.gas_used, 93657u64.into());
assert_eq!(tx.nonce, 10u64.into());
assert_eq!(tx.block_number, 2228258u64.into());
Expand Down
2 changes: 1 addition & 1 deletion ethers-providers/src/rpc/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,7 @@ mod tests {
// check that the second peer is in the list (it uses an enr so the enr should be Some)
assert_eq!(peers.len(), 1);

let peer = peers.get(0).unwrap();
let peer = peers.first().unwrap();
assert_eq!(H256::from_str(&peer.id).unwrap(), second_info.id);

// remove directories
Expand Down
4 changes: 2 additions & 2 deletions ethers-solc/src/artifact_output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,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 @@ -377,7 +377,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 ethers-solc/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 ethers-solc/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 ethers-solc/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