Skip to content

Commit

Permalink
Fix: clippy + imports
Browse files Browse the repository at this point in the history
  • Loading branch information
odesenfans committed Jan 19, 2024
1 parent 13c71bf commit 9a82194
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vm/src/serde/deserialize_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ fn deserialize_optional_felt_from_number<'de, D>(
where
D: Deserializer<'de>,
{
deserialize_felt_from_number(deserializer).map(|x| Some(x))
deserialize_felt_from_number(deserializer).map(Some)
}

fn deserialize_scientific_notation(n: Number) -> Option<Felt252> {
Expand Down
12 changes: 8 additions & 4 deletions vm/src/vm/runners/cairo_pie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl CairoPie {
Err(e) => return Err(e.into()),
}
let (address_bytes, value_bytes) = element.split_at(addr_size);
let address = Self::maybe_relocatable_from_le_bytes(address_bytes.clone());
let address = Self::maybe_relocatable_from_le_bytes(address_bytes);
let value = Self::maybe_relocatable_from_le_bytes(value_bytes);

match address {
Expand Down Expand Up @@ -404,9 +404,9 @@ mod serde_impl {
#[cfg(test)]
mod test {
use super::*;
use crate::utils::CAIRO_PRIME;
use rstest::rstest;
use std::fs::File;

#[cfg(feature = "std")]
use {crate::utils::CAIRO_PRIME, rstest::rstest, std::fs::File};

#[test]
fn serialize_cairo_pie_memory() {
Expand Down Expand Up @@ -477,6 +477,7 @@ mod test {
);
}

#[cfg(feature = "std")]
#[rstest]
#[case(0x8000_0000_0000_0000u64, 0, 0)]
#[case(0x8010_0000_0000_1000u64, 32, 0x1000)]
Expand All @@ -497,6 +498,7 @@ mod test {
);
}

#[cfg(feature = "std")]
#[rstest]
#[case([0, 0, 0, 0, 0, 0, 0], 0)]
#[case([0, 1, 2, 3, 4, 5, 6], 0x6050403020100)]
Expand All @@ -509,6 +511,7 @@ mod test {
);
}

#[cfg(feature = "std")]
#[test]
fn test_read_memory_file() {
let path = Path::new("../cairo_programs/manually_compiled/fibonacci_cairo_pie/memory.bin");
Expand All @@ -518,6 +521,7 @@ mod test {
assert_eq!(memory.len(), 88);
}

#[cfg(feature = "std")]
#[test]
fn test_cairo_pie_from_file() {
let path =
Expand Down

0 comments on commit 9a82194

Please sign in to comment.