Skip to content

Commit bbe21e4

Browse files
authored
Fixed clippy issues. (#1634)
1 parent 78eba19 commit bbe21e4

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

binaries/cairo-native-run/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ fn process_profile(
375375
.iter()
376376
.copied()
377377
.map(|x| x as f64)
378-
.map(|x| (x - average))
378+
.map(|x| x - average)
379379
.map(|x| x * x)
380380
.sum::<f64>();
381381
sum / (deltas.len() as u64 + extra_counts) as f64

debug_utils/sierra-emu/src/starknet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ impl StarknetSyscallHandler for StubSyscallHandler {
236236
fn keccak(&mut self, input: &[u64], gas: &mut u64) -> SyscallResult<U256> {
237237
let length = input.len();
238238

239-
if length % 17 != 0 {
239+
if !length.is_multiple_of(17) {
240240
let error_msg = b"Invalid keccak input size";
241241
let felt_error = Felt::from_bytes_be_slice(error_msg);
242242
return Err(vec![felt_error]);

debug_utils/src/bin/contract-to-sierra.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::fs::File;
22

33
use cairo_lang_starknet_classes::contract_class::ContractClass;
4-
use clap::{command, Parser};
4+
use clap::Parser;
55

66
/// Extracts sierra program from contract
77
#[derive(Parser, Debug)]

src/compiler.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,8 @@ fn compile_func(
697697
);
698698

699699
let mut new_state = state.clone();
700-
new_state.put_vars(
701-
branch_info.results.iter().zip(result_values.into_iter()),
702-
)?;
700+
new_state
701+
.put_vars(branch_info.results.iter().zip(result_values))?;
703702
Ok(new_state)
704703
})
705704
.collect::<Result<_, Error>>()?,

0 commit comments

Comments
 (0)