Skip to content

Commit

Permalink
refactor: use vecmap in place of standard iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jan 24, 2023
1 parent 46682b1 commit 5f97e69
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/noirc_abi/src/input_parser/toml.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::InputValue;
use crate::errors::InputParserError;
use acvm::FieldElement;
use iter_extended::{btree_map, try_btree_map, try_vecmap};
use iter_extended::{btree_map, try_btree_map, try_vecmap, vecmap};
use serde::Serialize;
use serde_derive::Deserialize;
use std::{collections::BTreeMap, convert::TryFrom};
Expand Down Expand Up @@ -103,10 +103,8 @@ impl TryFrom<TomlTypes> for InputValue {
InputValue::Field(new_value)
}
TomlTypes::ArrayNum(arr_num) => {
let array_elements: Vec<_> = arr_num
.into_iter()
.map(|elem_num| FieldElement::from(i128::from(elem_num)))
.collect();
let array_elements =
vecmap(arr_num, |elem_num| FieldElement::from(i128::from(elem_num)));

InputValue::Vec(array_elements)
}
Expand Down

0 comments on commit 5f97e69

Please sign in to comment.