Skip to content

Commit 2d6fbeb

Browse files
authored
chore: make clippy happy (#334)
1 parent 326f794 commit 2d6fbeb

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

crates/artifacts/solc/src/ast/lowfidelity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ pub struct Node {
4040

4141
/// Child nodes for some node types.
4242
#[serde(default)]
43-
pub nodes: Vec<Node>,
43+
pub nodes: Vec<Self>,
4444

4545
/// Body node for some node types.
4646
#[serde(default, skip_serializing_if = "Option::is_none")]
47-
pub body: Option<Box<Node>>,
47+
pub body: Option<Box<Self>>,
4848

4949
/// Node attributes that were not deserialized.
5050
#[serde(flatten)]

crates/artifacts/solc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ pub struct Item {
14471447
#[serde(rename = "type")]
14481448
pub put_type: String,
14491449
#[serde(default, skip_serializing_if = "Vec::is_empty")]
1450-
pub components: Vec<Item>,
1450+
pub components: Vec<Self>,
14511451
/// Indexed flag. for solidity events
14521452
#[serde(default, skip_serializing_if = "Option::is_none")]
14531453
pub indexed: Option<bool>,

crates/compilers/src/compilers/solc/compiler.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,7 @@ fn version_from_output(output: Output) -> Result<Version> {
618618
let stdout = String::from_utf8_lossy(&output.stdout);
619619
let version = stdout
620620
.lines()
621-
.filter(|l| !l.trim().is_empty())
622-
.next_back()
621+
.rfind(|l| !l.trim().is_empty())
623622
.ok_or_else(|| SolcError::msg("Version not found in Solc output"))?;
624623
// NOTE: semver doesn't like `+` in g++ in build metadata which is invalid semver
625624
Ok(Version::from_str(&version.trim_start_matches("Version: ").replace(".g++", ".gcc"))?)

crates/core/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub enum SolcError {
5959
--> {1}\n\t\
6060
{2}"
6161
)]
62-
FailedResolveImport(Box<SolcError>, PathBuf, PathBuf),
62+
FailedResolveImport(Box<Self>, PathBuf, PathBuf),
6363
#[cfg(feature = "svm-solc")]
6464
#[error(transparent)]
6565
SvmError(#[from] svm::SvmError),

0 commit comments

Comments
 (0)