Skip to content

Commit

Permalink
Fixed some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvalsw committed Feb 27, 2025
1 parent 3de653d commit 99bf52a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
7 changes: 1 addition & 6 deletions vm/src/hint_processor/builtin_hint_processor/signature.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::stdlib::{boxed::Box, collections::HashMap, prelude::*};

use num_integer::Integer;

use crate::{
hint_processor::{
builtin_hint_processor::hint_utils::{get_integer_from_var_name, get_ptr_from_var_name},
Expand All @@ -27,10 +25,7 @@ pub fn verify_ecdsa_signature(
if ecdsa_ptr.segment_index != ecdsa_builtin.base() as isize {
return Err(HintError::AddSignatureWrongEcdsaPtr(Box::new(ecdsa_ptr)));
}
if !ecdsa_ptr
.offset
.is_multiple_of(&(CELLS_PER_SIGNATURE as usize))
{
if !num_integer::Integer::is_multiple_of(&ecdsa_ptr.offset, &(CELLS_PER_SIGNATURE as usize)) {
return Err(HintError::AddSignatureNotAPublicKey(Box::new(ecdsa_ptr)));
}
ecdsa_builtin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl DictManagerExecScope {
if self.use_temporary_segments {
let mut prev_end = vm.add_memory_segment();
for tracker in &self.trackers {
vm.add_relocation_rule(tracker.start, prev_end.into())?;
vm.add_relocation_rule(tracker.start, prev_end)?;
prev_end += (tracker.end.unwrap_or_default() - tracker.start)?;
prev_end += 1;
}
Expand Down
3 changes: 1 addition & 2 deletions vm/src/vm/runners/cairo_pie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ impl CairoPie {
pub(super) mod serde_impl {
use crate::stdlib::collections::HashMap;
use crate::types::builtin_name::BuiltinName;
use num_integer::Integer;
use num_traits::Num;

use super::CAIRO_PIE_VERSION;
Expand Down Expand Up @@ -723,7 +722,7 @@ pub(super) mod serde_impl {
}

pub fn from_bytes(bytes: &[u8]) -> Option<CairoPieMemory> {
if !bytes.len().is_multiple_of(&CELL_BYTE_LEN) {
if !num_integer::Integer::is_multiple_of(&bytes.len(), &CELL_BYTE_LEN) {
return None;
}

Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/vm_memory/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl Memory {
}

/// Retrieve a value from memory (either normal or temporary) and apply relocation rules
pub(crate) fn get<'a, 'b: 'a, K: 'a>(&'b self, key: &'a K) -> Option<Cow<MaybeRelocatable>>
pub(crate) fn get<'a, 'b: 'a, K: 'a>(&'b self, key: &'a K) -> Option<Cow<'b, MaybeRelocatable>>
where
Relocatable: TryFrom<&'a K>,
{
Expand Down

0 comments on commit 99bf52a

Please sign in to comment.