Skip to content

Commit

Permalink
lint: rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
whichqua committed Jun 5, 2024
1 parent a76fec3 commit 3597f30
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 28 deletions.
10 changes: 4 additions & 6 deletions src/hints/execute_task_hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,7 @@ mod tests {
#[fixture]
fn fibonacci() -> Program {
let program_content =
include_bytes!("../../test-programs/cairo0/fibonacci/fibonacci.json")
.to_vec();
include_bytes!("../../test-programs/cairo0/fibonacci/fibonacci.json").to_vec();

Program::from_bytes(&program_content, Some("main"))
.expect("Loading example program failed unexpectedly")
Expand All @@ -562,10 +561,9 @@ mod tests {

#[fixture]
fn field_arithmetic_program() -> Program {
let program_content = include_bytes!(
"../../test-programs/cairo0/field-arithmetic/field_arithmetic.json"
)
.to_vec();
let program_content =
include_bytes!("../../test-programs/cairo0/field-arithmetic/field_arithmetic.json")
.to_vec();

Program::from_bytes(&program_content, Some("main"))
.expect("Loading example program failed unexpectedly")
Expand Down
3 changes: 1 addition & 2 deletions src/hints/program_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ mod tests {
#[fixture]
fn fibonacci() -> Program {
let program_content =
include_bytes!("../../test-programs/cairo0/fibonacci/fibonacci.json")
.to_vec();
include_bytes!("../../test-programs/cairo0/fibonacci/fibonacci.json").to_vec();

Program::from_bytes(&program_content, Some("main"))
.expect("Loading example program failed unexpectedly")
Expand Down
23 changes: 8 additions & 15 deletions src/hints/simple_bootloader_hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,29 +134,22 @@ mod tests {
use std::collections::HashMap;

use cairo_vm::hint_processor::builtin_hint_processor::hint_utils::{
get_ptr_from_var_name,
insert_value_from_var_name,
get_ptr_from_var_name, insert_value_from_var_name,
};

use cairo_vm::serde::deserialize_program::ApTracking;
use cairo_vm::types::exec_scope::ExecutionScopes;
use cairo_vm::types::program::Program;
use cairo_vm::types::relocatable::{Relocatable};




use cairo_vm::types::relocatable::Relocatable;

use cairo_vm::vm::vm_core::VirtualMachine;
use cairo_vm::{Felt252};

use cairo_vm::Felt252;
use num_traits::ToPrimitive;
use rstest::{fixture, rstest};


use crate::hints::fact_topologies::{FactTopology};



use crate::hints::fact_topologies::FactTopology;

use crate::hints::types::{Task, TaskSpec};
use crate::hints::vars;
use crate::{add_segments, define_segments, ids_data, vm};
Expand Down
5 changes: 0 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ macro_rules! non_continuous_ids_data {
};
}


#[macro_export]
macro_rules! insert_value_inner {
($vm:expr, ($si:expr, $off:expr), ($sival:expr, $offval: expr)) => {
Expand All @@ -101,12 +100,10 @@ macro_rules! insert_value_inner {
&$crate::mayberelocatable!($sival, $offval),
);
$vm.insert_value(k, v).unwrap();

};
($vm:expr, ($si:expr, $off:expr), $val:expr) => {
let (k, v) = (($si, $off).into(), &$crate::mayberelocatable!($val));
$vm.insert_value(k, v).unwrap();

};
}

Expand All @@ -132,7 +129,6 @@ macro_rules! define_segments {
};
}


#[macro_export]
macro_rules! run_hint {
($vm:expr, $ids_data:expr, $hint_code:expr, $exec_scopes:expr, $constants:expr) => {{
Expand Down Expand Up @@ -167,4 +163,3 @@ macro_rules! run_hint {
)
}};
}

0 comments on commit 3597f30

Please sign in to comment.