diff --git a/crates/web-client/src/miden_array.rs b/crates/web-client/src/miden_array.rs index f562bb4f..c1391d39 100644 --- a/crates/web-client/src/miden_array.rs +++ b/crates/web-client/src/miden_array.rs @@ -96,6 +96,18 @@ macro_rules! declare_js_miden_arrays { Self::new(Some(vec)) } } + + impl $miden_type_array_name { + #[allow(dead_code)] + pub(crate) fn iter(&self) -> core::slice::Iter<'_, $miden_type_name> { + self.__inner.iter() + } + + #[allow(dead_code)] + pub(crate) fn into_iter(self) -> alloc::vec::IntoIter<$miden_type_name> { + self.__inner.into_iter() + } + } )+ } }; diff --git a/crates/web-client/src/models/account_component.rs b/crates/web-client/src/models/account_component.rs index 65d3502f..a38037c5 100644 --- a/crates/web-client/src/models/account_component.rs +++ b/crates/web-client/src/models/account_component.rs @@ -211,7 +211,6 @@ impl AccountComponent { let native_package: NativePackage = package.into(); let native_library = (*native_package.mast).clone(); let native_slots: Vec = storage_slots - .__inner .iter() .map(|storage_slot| storage_slot.clone().into()) .collect(); diff --git a/crates/web-client/src/models/felt.rs b/crates/web-client/src/models/felt.rs index 48d16a88..2dfb35ee 100644 --- a/crates/web-client/src/models/felt.rs +++ b/crates/web-client/src/models/felt.rs @@ -62,6 +62,6 @@ impl From<&Felt> for NativeFelt { impl From<&FeltArray> for Vec { fn from(felt_array: &FeltArray) -> Self { - felt_array.__inner.iter().map(Into::into).collect() + felt_array.iter().map(Into::into).collect() } } diff --git a/crates/web-client/src/models/note.rs b/crates/web-client/src/models/note.rs index 52c53686..84128584 100644 --- a/crates/web-client/src/models/note.rs +++ b/crates/web-client/src/models/note.rs @@ -193,12 +193,12 @@ impl From<&Note> for NativeNote { impl From for Vec { fn from(note_array: crate::models::miden_arrays::NoteArray) -> Self { - note_array.__inner.into_iter().map(Into::into).collect() + note_array.into_iter().map(Into::into).collect() } } impl From<&crate::models::miden_arrays::NoteArray> for Vec { fn from(note_array: &crate::models::miden_arrays::NoteArray) -> Self { - note_array.__inner.iter().cloned().map(Into::into).collect() + note_array.iter().cloned().map(Into::into).collect() } } diff --git a/crates/web-client/src/models/note_recipient.rs b/crates/web-client/src/models/note_recipient.rs index 4ac8d675..92b386a5 100644 --- a/crates/web-client/src/models/note_recipient.rs +++ b/crates/web-client/src/models/note_recipient.rs @@ -93,7 +93,6 @@ impl From<&NoteRecipient> for NativeNoteRecipient { impl From<&RecipientArray> for Vec { fn from(recipient_array: &RecipientArray) -> Self { recipient_array - .__inner .iter() .map(NativeNoteRecipient::from) .collect() diff --git a/crates/web-client/src/models/output_note.rs b/crates/web-client/src/models/output_note.rs index 6492690e..b5a984ca 100644 --- a/crates/web-client/src/models/output_note.rs +++ b/crates/web-client/src/models/output_note.rs @@ -96,21 +96,12 @@ impl From<&OutputNote> for NativeRawOutputNote { impl From for Vec { fn from(output_notes_array: OutputNoteArray) -> Self { - output_notes_array - .__inner - .into_iter() - .map(Into::into) - .collect() + output_notes_array.into_iter().map(Into::into).collect() } } impl From<&OutputNoteArray> for Vec { fn from(output_notes_array: &OutputNoteArray) -> Self { - output_notes_array - .__inner - .iter() - .cloned() - .map(Into::into) - .collect() + output_notes_array.iter().cloned().map(Into::into).collect() } } diff --git a/crates/web-client/src/models/transaction_request/note_and_args.rs b/crates/web-client/src/models/transaction_request/note_and_args.rs index b6243671..67604b99 100644 --- a/crates/web-client/src/models/transaction_request/note_and_args.rs +++ b/crates/web-client/src/models/transaction_request/note_and_args.rs @@ -45,16 +45,12 @@ impl From<&NoteAndArgs> for (NativeNote, Option) { impl From for Vec<(NativeNote, Option)> { fn from(note_and_args_array: NoteAndArgsArray) -> Self { - note_and_args_array - .__inner - .into_iter() - .map(Into::into) - .collect() + note_and_args_array.into_iter().map(Into::into).collect() } } impl From<&NoteAndArgsArray> for Vec<(NativeNote, Option)> { fn from(note_and_args_array: &NoteAndArgsArray) -> Self { - note_and_args_array.__inner.iter().map(Into::into).collect() + note_and_args_array.iter().map(Into::into).collect() } } diff --git a/crates/web-client/src/models/transaction_request/note_details_and_tag.rs b/crates/web-client/src/models/transaction_request/note_details_and_tag.rs index 9e7f6404..df4b3f29 100644 --- a/crates/web-client/src/models/transaction_request/note_details_and_tag.rs +++ b/crates/web-client/src/models/transaction_request/note_details_and_tag.rs @@ -55,7 +55,6 @@ impl From<&NoteDetailsAndTag> for (NativeNoteDetails, NativeNoteTag) { impl From for Vec<(NativeNoteDetails, NativeNoteTag)> { fn from(note_details_and_tag_array: NoteDetailsAndTagArray) -> Self { note_details_and_tag_array - .__inner .into_iter() .map(Into::into) .collect() @@ -64,10 +63,6 @@ impl From for Vec<(NativeNoteDetails, NativeNoteTag)> { impl From<&NoteDetailsAndTagArray> for Vec<(NativeNoteDetails, NativeNoteTag)> { fn from(note_details_and_tag_array: &NoteDetailsAndTagArray) -> Self { - note_details_and_tag_array - .__inner - .iter() - .map(Into::into) - .collect() + note_details_and_tag_array.iter().map(Into::into).collect() } } diff --git a/crates/web-client/src/models/transaction_request/note_id_and_args.rs b/crates/web-client/src/models/transaction_request/note_id_and_args.rs index f78cf048..bc05f464 100644 --- a/crates/web-client/src/models/transaction_request/note_id_and_args.rs +++ b/crates/web-client/src/models/transaction_request/note_id_and_args.rs @@ -44,20 +44,12 @@ impl From<&NoteIdAndArgs> for (NativeNoteId, Option) { impl From for Vec<(NativeNoteId, Option)> { fn from(note_id_and_args_array: NoteIdAndArgsArray) -> Self { - note_id_and_args_array - .__inner - .into_iter() - .map(Into::into) - .collect() + note_id_and_args_array.into_iter().map(Into::into).collect() } } impl From<&NoteIdAndArgsArray> for Vec<(NativeNoteId, Option)> { fn from(note_id_and_args_array: &NoteIdAndArgsArray) -> Self { - note_id_and_args_array - .__inner - .iter() - .map(Into::into) - .collect() + note_id_and_args_array.iter().map(Into::into).collect() } } diff --git a/crates/web-client/src/models/transaction_request/transaction_request_builder.rs b/crates/web-client/src/models/transaction_request/transaction_request_builder.rs index 1fbe4828..5dc3d0cd 100644 --- a/crates/web-client/src/models/transaction_request/transaction_request_builder.rs +++ b/crates/web-client/src/models/transaction_request/transaction_request_builder.rs @@ -99,7 +99,6 @@ impl TransactionRequestBuilder { #[wasm_bindgen(js_name = "withForeignAccounts")] pub fn with_foreign_accounts(mut self, foreign_accounts: &ForeignAccountArray) -> Self { let native_foreign_accounts: Vec = foreign_accounts - .__inner .iter() .map(|account| account.clone().into()) .collect(); diff --git a/crates/web-client/src/models/transaction_script_inputs.rs b/crates/web-client/src/models/transaction_script_inputs.rs index 32165c50..2b794ce7 100644 --- a/crates/web-client/src/models/transaction_script_inputs.rs +++ b/crates/web-client/src/models/transaction_script_inputs.rs @@ -40,7 +40,6 @@ impl From for (NativeWord, Vec) { let native_word: NativeWord = transaction_script_input_pair.word.into(); let native_felts: Vec = transaction_script_input_pair .felts - .__inner .into_iter() .map(Into::into) .collect(); @@ -53,7 +52,6 @@ impl From<&TransactionScriptInputPair> for (NativeWord, Vec) { let native_word: NativeWord = transaction_script_input_pair.word.clone().into(); let native_felts: Vec = transaction_script_input_pair .felts - .__inner .iter() .map(|felt| (*felt).into()) .collect(); @@ -64,7 +62,6 @@ impl From<&TransactionScriptInputPair> for (NativeWord, Vec) { impl From for Vec<(NativeWord, Vec)> { fn from(transaction_script_input_pair_array: TransactionScriptInputPairArray) -> Self { transaction_script_input_pair_array - .__inner .into_iter() .map(Into::into) .collect() @@ -74,7 +71,6 @@ impl From for Vec<(NativeWord, Vec) impl From<&TransactionScriptInputPairArray> for Vec<(NativeWord, Vec)> { fn from(transaction_script_input_pair_array: &TransactionScriptInputPairArray) -> Self { transaction_script_input_pair_array - .__inner .iter() .map(Into::into) .collect() diff --git a/crates/web-client/src/new_transactions.rs b/crates/web-client/src/new_transactions.rs index d727bfb9..30898953 100644 --- a/crates/web-client/src/new_transactions.rs +++ b/crates/web-client/src/new_transactions.rs @@ -177,7 +177,6 @@ impl WebClient { if let Some(client) = self.get_mut_inner() { let foreign_accounts_map: BTreeMap = foreign_accounts - .__inner .iter() .map(|a| { let fa: NativeForeignAccount = a.clone().into();