Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Jun 17, 2024
1 parent 11fc1c1 commit 2b07b50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/artifacts/solc/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,9 +906,9 @@ pub enum AssemblyReferenceSuffix {
impl fmt::Display for AssemblyReferenceSuffix {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
AssemblyReferenceSuffix::Slot => f.write_str("slot"),
AssemblyReferenceSuffix::Offset => f.write_str("offset"),
AssemblyReferenceSuffix::Length => f.write_str("length"),
Self::Slot => f.write_str("slot"),
Self::Offset => f.write_str("offset"),
Self::Length => f.write_str("length"),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/compilers/src/compilers/solc/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ impl Solc {
let solc = if let Some(solc) = Self::find_svm_installed_version(version)? {
solc
} else {
Self::blocking_install(&version)?
Self::blocking_install(version)?
};

Ok(solc)
Expand Down
6 changes: 4 additions & 2 deletions crates/compilers/src/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ impl Visitor for ReferencesCollector {
// If suffix is used in assembly reference (e.g. value.slot), it will be included into src.
// However, we are only interested in the referenced name, thus we strip .<suffix> part.
if let Some(suffix) = &reference.suffix {
let suffix_len = suffix.to_string().len();
src.length.as_mut().map(|len| *len -= suffix_len + 1);
if let Some(len) = src.length.as_mut() {
let suffix_len = suffix.to_string().len();
*len -= suffix_len + 1;
}
}

self.process_referenced_declaration(reference.declaration as isize, &src);
Expand Down

0 comments on commit 2b07b50

Please sign in to comment.