Skip to content

Commit c06d117

Browse files
committed
fmt
1 parent 2d5c472 commit c06d117

File tree

10 files changed

+17
-23
lines changed

10 files changed

+17
-23
lines changed

crates/cheatcodes/src/inspector.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ impl Cheatcodes {
17981798
}
17991799

18001800
#[cold]
1801-
fn meter_gas_end(&mut self, interpreter: &mut Interpreter) {
1801+
fn meter_gas_end(&mut self, interpreter: &Interpreter) {
18021802
// Remove recorded gas if we exit frame.
18031803
if will_exit(interpreter.instruction_result) {
18041804
self.gas_metering.paused_frames.pop();
@@ -1812,7 +1812,7 @@ impl Cheatcodes {
18121812
}
18131813

18141814
#[cold]
1815-
fn meter_gas_check(&mut self, interpreter: &mut Interpreter) {
1815+
fn meter_gas_check(&self, interpreter: &mut Interpreter) {
18161816
if will_exit(interpreter.instruction_result) {
18171817
// Reset gas if spent is less than refunded.
18181818
// This can happen if gas was paused / resumed or reset.
@@ -1833,7 +1833,7 @@ impl Cheatcodes {
18331833
/// cache) from mapped source address to the target address.
18341834
/// - generates arbitrary value and saves it in target address storage.
18351835
#[cold]
1836-
fn arbitrary_storage_end(&mut self, interpreter: &mut Interpreter, ecx: Ecx) {
1836+
fn arbitrary_storage_end(&mut self, interpreter: &Interpreter, ecx: Ecx) {
18371837
let (key, target_address) = if interpreter.current_opcode() == op::SLOAD {
18381838
(try_or_return!(interpreter.stack().peek(0)), interpreter.contract().target_address)
18391839
} else {
@@ -1867,7 +1867,7 @@ impl Cheatcodes {
18671867

18681868
/// Records storage slots reads and writes.
18691869
#[cold]
1870-
fn record_accesses(&mut self, interpreter: &mut Interpreter) {
1870+
fn record_accesses(&mut self, interpreter: &Interpreter) {
18711871
let Some(access) = &mut self.accesses else { return };
18721872
match interpreter.current_opcode() {
18731873
op::SLOAD => {
@@ -1883,7 +1883,7 @@ impl Cheatcodes {
18831883
}
18841884

18851885
#[cold]
1886-
fn record_state_diffs(&mut self, interpreter: &mut Interpreter, ecx: Ecx) {
1886+
fn record_state_diffs(&mut self, interpreter: &Interpreter, ecx: Ecx) {
18871887
let Some(account_accesses) = &mut self.recorded_account_diffs_stack else { return };
18881888
match interpreter.current_opcode() {
18891889
op::SELFDESTRUCT => {

crates/config/src/etherscan.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl ResolvedEtherscanConfigs {
138138
match config {
139139
Ok(c) if c.chain == Some(chain) => return Some(Ok(c)),
140140
Err(e) => return Some(Err(e)),
141-
_ => continue,
141+
Ok(_) => {}
142142
}
143143
}
144144
None

crates/config/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1960,9 +1960,8 @@ impl Config {
19601960
}
19611961
if let Ok(entries) = cache_dir.as_path().read_dir() {
19621962
for entry in entries.flatten().filter(|x| x.path().is_dir()) {
1963-
match Chain::from_str(&entry.file_name().to_string_lossy()) {
1964-
Ok(chain) => cache.chains.push(Self::list_foundry_chain_cache(chain)?),
1965-
Err(_) => continue,
1963+
if let Ok(chain) = Chain::from_str(&entry.file_name().to_string_lossy()) {
1964+
cache.chains.push(Self::list_foundry_chain_cache(chain)?);
19661965
}
19671966
}
19681967
Ok(cache)

crates/evm/evm/src/executors/invariant/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ impl<'a> InvariantExecutor<'a> {
663663
/// Makes sure that the contract exists in the project. If so, it returns its artifact
664664
/// identifier.
665665
fn validate_selected_contract(
666-
&mut self,
666+
&self,
667667
contract: String,
668668
selectors: &[FixedBytes<4>],
669669
) -> Result<String> {

crates/evm/evm/src/inspectors/stack.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ impl InspectorStackRefMut<'_> {
487487
/// Should be called on the top-level call of inner context (depth == 0 &&
488488
/// self.in_inner_context) Decreases sender nonce for CALLs to keep backwards compatibility
489489
/// Updates tx.origin to the value before entering inner context
490-
fn adjust_evm_data_for_inner_context(&mut self, ecx: &mut EvmContext<&mut dyn DatabaseExt>) {
490+
fn adjust_evm_data_for_inner_context(&self, ecx: &mut EvmContext<&mut dyn DatabaseExt>) {
491491
let inner_context_data =
492492
self.inner_context_data.as_ref().expect("should be called in inner context");
493493
ecx.env.tx.caller = inner_context_data.original_origin;
@@ -717,7 +717,7 @@ impl InspectorStackRefMut<'_> {
717717
}
718718

719719
/// Invoked at the beginning of a new top-level (0 depth) frame.
720-
fn top_level_frame_start(&mut self, ecx: &mut EvmContext<&mut dyn DatabaseExt>) {
720+
fn top_level_frame_start(&mut self, ecx: &EvmContext<&mut dyn DatabaseExt>) {
721721
if self.enable_isolation {
722722
// If we're in isolation mode, we need to keep track of the state at the beginning of
723723
// the frame to be able to roll back on revert

crates/evm/fuzz/src/inspector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<DB: Database> Inspector<DB> for Fuzzer {
6060

6161
impl Fuzzer {
6262
/// Collects `stack` and `memory` values into the fuzz dictionary.
63-
fn collect_data(&mut self, interpreter: &Interpreter) {
63+
fn collect_data(&self, interpreter: &Interpreter) {
6464
self.fuzz_state.collect_values(interpreter.stack().data().iter().copied().map(Into::into));
6565

6666
// TODO: disabled for now since it's flooding the dictionary

crates/fmt/src/formatter.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,7 @@ impl<'a, W: Write> Formatter<'a, W> {
322322
/// If the block style is configured to [SingleLineBlockStyle::Preserve],
323323
/// lookup whether there was a newline introduced in `[start_from, end_at]` range
324324
/// where `end_at` is the start of the block.
325-
fn should_attempt_block_single_line(
326-
&self,
327-
stmt: &mut Statement,
328-
start_from: usize,
329-
) -> bool {
325+
fn should_attempt_block_single_line(&self, stmt: &mut Statement, start_from: usize) -> bool {
330326
match self.config.single_line_statement_blocks {
331327
SingleLineBlockStyle::Single => true,
332328
SingleLineBlockStyle::Multi => false,

crates/forge/src/cmd/install.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl Installer<'_> {
432432
sh_println!("[{i}] {c} selected")?;
433433
return Ok(c.clone())
434434
}
435-
_ => continue,
435+
_ => {}
436436
}
437437
}
438438
}

crates/script/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ impl ScriptArgs {
414414
bytecodes.push((format!("Unknown{unknown_c}"), init_code, deployed_code));
415415
unknown_c += 1;
416416
}
417-
continue;
418417
}
419418

420419
let mut prompt_user = false;

crates/verify/src/etherscan/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl EtherscanVerificationProvider {
214214

215215
/// Configures the API request to the Etherscan API using the given [`VerifyArgs`].
216216
async fn prepare_verify_request(
217-
&mut self,
217+
&self,
218218
args: &VerifyArgs,
219219
context: &VerificationContext,
220220
) -> Result<(Client, VerifyContract)> {
@@ -305,7 +305,7 @@ impl EtherscanVerificationProvider {
305305
/// If `--flatten` is set to `true` then this will send with [`CodeFormat::SingleFile`]
306306
/// otherwise this will use the [`CodeFormat::StandardJsonInput`]
307307
pub async fn create_verify_request(
308-
&mut self,
308+
&self,
309309
args: &VerifyArgs,
310310
context: &VerificationContext,
311311
) -> Result<VerifyContract> {
@@ -353,7 +353,7 @@ impl EtherscanVerificationProvider {
353353
/// constructor arguments was provided, read them and encode. Otherwise,
354354
/// return whatever was set in the [VerifyArgs] args.
355355
async fn constructor_args(
356-
&mut self,
356+
&self,
357357
args: &VerifyArgs,
358358
context: &VerificationContext,
359359
) -> Result<Option<String>> {

0 commit comments

Comments
 (0)