Skip to content

Commit

Permalink
fix: type annotations error fix for miden-wasm (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
dagarcia7 authored and bobbinth committed Jul 4, 2024
1 parent e6675bf commit ee5e938
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion objects/src/testing/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ impl<T: Rng> AccountBuilder<T> {
let inner_storage = self.storage_builder.build();

for (key, value) in inner_storage.slots().leaves() {
if key != AccountStorage::SLOT_LAYOUT_COMMITMENT_INDEX.into() {
// Explicitly cast to `u64` to silence "type annotations needed" error.
// Using `as u64` makes the intended type clear and avoids type inference issues.
if key != AccountStorage::SLOT_LAYOUT_COMMITMENT_INDEX as u64 {
// don't copy the reserved key
storage.set_item(key as u8, *value).map_err(AccountBuilderError::AccountError)?;
}
Expand Down

0 comments on commit ee5e938

Please sign in to comment.