Skip to content

Commit

Permalink
lint: fix addressable clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfertel committed Apr 22, 2024
1 parent 6a6af83 commit 2a22fe5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/scaffold/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl<'s> Visitor for EmitterI<'s> {
) -> result::Result<Self::CommentOutput, Self::Error> {
let mut emitted = String::new();
let indentation = self.emitter.indent().repeat(2);
emitted.push_str(format!("{}// {}\n", indentation, comment.lexeme).as_str());
emitted.push_str(format!("{indentation}// {}\n", comment.lexeme).as_str());

Ok(emitted)
}
Expand All @@ -253,7 +253,7 @@ impl<'s> Visitor for EmitterI<'s> {
// Match any supported statement to its string representation
match statement.ty {
hir::StatementType::VmSkip => {
emitted.push_str(format!("{}vm.skip(true);\n", indentation).as_str());
emitted.push_str(format!("{indentation}vm.skip(true);\n").as_str());
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/scaffold/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//!
//! This command scaffolds a Solidity file from a spec `.tree` file.

use std::path::Path;
use std::{fs, path::PathBuf};

use clap::Parser;
Expand Down Expand Up @@ -65,7 +66,7 @@ impl Scaffold {
continue;
}

let file = self.to_test_file(file);
let file = Self::to_test_file(file);
self.write_file(&emitted, &file);
}
Err(err) => {
Expand Down Expand Up @@ -95,8 +96,8 @@ impl Scaffold {
}

/// Gets the `t.sol` path equivalent of `file`.
fn to_test_file(&self, file: &PathBuf) -> PathBuf {
let mut file = file.clone();
fn to_test_file(file: &Path) -> PathBuf {
let mut file = file.to_path_buf();
file.set_extension("t.sol");
file
}
Expand Down

0 comments on commit 2a22fe5

Please sign in to comment.