Skip to content

Commit

Permalink
chore: clippy (#2506)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jul 11, 2023
1 parent bee67cc commit f9c72f2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ethers-solc/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ impl CacheEntry {
entry.insert(artifacts);
}
Entry::Occupied(mut entry) => {
entry.get_mut().extend(artifacts.into_iter());
entry.get_mut().extend(artifacts);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ethers-solc/src/compile/output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
};
use contracts::{VersionedContract, VersionedContracts};
use semver::Version;
use serde::{Serialize, Deserialize};
use serde::{Deserialize, Serialize};
use std::{collections::BTreeMap, fmt, path::Path};
use tracing::trace;
use yansi::Paint;
Expand Down
3 changes: 1 addition & 2 deletions ethers-solc/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,7 @@ impl ProjectPathsConfig {
if cap.name("ignore").is_some() {
continue
}
if let Some(name_match) =
vec!["n1", "n2", "n3"].iter().find_map(|name| cap.name(name))
if let Some(name_match) = ["n1", "n2", "n3"].iter().find_map(|name| cap.name(name))
{
let name_match_range =
utils::range_by_offset(&name_match.range(), replace_offset);
Expand Down
4 changes: 1 addition & 3 deletions ethers-solc/src/resolver/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,7 @@ fn capture_outer_and_inner<'a>(
pub fn capture_imports(content: &str) -> Vec<SolDataUnit<SolImport>> {
let mut imports = vec![];
for cap in utils::RE_SOL_IMPORT.captures_iter(content) {
if let Some(name_match) =
vec!["p1", "p2", "p3", "p4"].iter().find_map(|name| cap.name(name))
{
if let Some(name_match) = ["p1", "p2", "p3", "p4"].iter().find_map(|name| cap.name(name)) {
let statement_match = cap.get(0).unwrap();
let mut aliases = vec![];
for alias_cap in utils::RE_SOL_IMPORT_ALIAS.captures_iter(statement_match.as_str()) {
Expand Down
4 changes: 2 additions & 2 deletions ethers-solc/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,13 +617,13 @@ import './../libraries/JBTokens.sol';

#[test]
fn can_find_import_paths() {
let s = r##"//SPDX-License-Identifier: Unlicense
let s = r#"//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "hardhat/console.sol";
import "../contract/Contract.sol";
import { T } from "../Test.sol";
import { T } from '../Test2.sol';
"##;
"#;
assert_eq!(
vec!["hardhat/console.sol", "../contract/Contract.sol", "../Test.sol", "../Test2.sol"],
find_import_paths(s).map(|m| m.as_str()).collect::<Vec<&str>>()
Expand Down
2 changes: 1 addition & 1 deletion examples/events/examples/filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const USDT_ADDRESS: &str = "0xdAC17F958D2ee523a2206206994597C13D831ec7";
async fn main() -> Result<()> {
let provider = Provider::<Http>::try_from(HTTP_URL)?;
let client = Arc::new(provider);
let token_topics = vec![
let token_topics = [
H256::from(USDC_ADDRESS.parse::<H160>()?),
H256::from(USDT_ADDRESS.parse::<H160>()?),
H256::from(DAI_ADDRESS.parse::<H160>()?),
Expand Down

0 comments on commit f9c72f2

Please sign in to comment.