diff --git a/crates/artifacts/solc/src/ast/lowfidelity.rs b/crates/artifacts/solc/src/ast/lowfidelity.rs index 33df93a1a..57e1c2746 100644 --- a/crates/artifacts/solc/src/ast/lowfidelity.rs +++ b/crates/artifacts/solc/src/ast/lowfidelity.rs @@ -40,11 +40,11 @@ pub struct Node { /// Child nodes for some node types. #[serde(default)] - pub nodes: Vec, + pub nodes: Vec, /// Body node for some node types. #[serde(default, skip_serializing_if = "Option::is_none")] - pub body: Option>, + pub body: Option>, /// Node attributes that were not deserialized. #[serde(flatten)] diff --git a/crates/artifacts/solc/src/lib.rs b/crates/artifacts/solc/src/lib.rs index 821dace9a..7694e7243 100644 --- a/crates/artifacts/solc/src/lib.rs +++ b/crates/artifacts/solc/src/lib.rs @@ -1447,7 +1447,7 @@ pub struct Item { #[serde(rename = "type")] pub put_type: String, #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub components: Vec, + pub components: Vec, /// Indexed flag. for solidity events #[serde(default, skip_serializing_if = "Option::is_none")] pub indexed: Option, diff --git a/crates/compilers/src/compilers/solc/compiler.rs b/crates/compilers/src/compilers/solc/compiler.rs index 8e672092a..7818652a3 100644 --- a/crates/compilers/src/compilers/solc/compiler.rs +++ b/crates/compilers/src/compilers/solc/compiler.rs @@ -618,8 +618,7 @@ fn version_from_output(output: Output) -> Result { let stdout = String::from_utf8_lossy(&output.stdout); let version = stdout .lines() - .filter(|l| !l.trim().is_empty()) - .next_back() + .rfind(|l| !l.trim().is_empty()) .ok_or_else(|| SolcError::msg("Version not found in Solc output"))?; // NOTE: semver doesn't like `+` in g++ in build metadata which is invalid semver Ok(Version::from_str(&version.trim_start_matches("Version: ").replace(".g++", ".gcc"))?) diff --git a/crates/core/src/error.rs b/crates/core/src/error.rs index b6526f004..eab098142 100644 --- a/crates/core/src/error.rs +++ b/crates/core/src/error.rs @@ -59,7 +59,7 @@ pub enum SolcError { --> {1}\n\t\ {2}" )] - FailedResolveImport(Box, PathBuf, PathBuf), + FailedResolveImport(Box, PathBuf, PathBuf), #[cfg(feature = "svm-solc")] #[error(transparent)] SvmError(#[from] svm::SvmError),