Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer committed Nov 9, 2023
1 parent ad072cc commit 8fbc2ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
4 changes: 3 additions & 1 deletion assembly/src/ast/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ impl ModuleImports {
/// Look up the actual procedure name and module path associated with the given [ProcedureId],
/// if that procedure was imported and invoked in the current module.
pub fn get_procedure_info(&self, id: &ProcedureId) -> Option<(&ProcedureName, &LibraryPath)> {
self.invoked_procs.get(id).map(|(name, path)| (name, path))
self.invoked_procs
.get(id)
.map(|invoked_proc| (&invoked_proc.0, &invoked_proc.1))
}

/// Look up the procedure name associated with the given [ProcedureId],
Expand Down
10 changes: 2 additions & 8 deletions core/src/stack/inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,8 @@ impl StackInputs {
where
I: IntoIterator<Item = u64>,
{
iter.into_iter()
.map(|v| {
Felt::try_from(v).map_err(|_| {
InputError::NotFieldElement(v, "the provided value isn't a valid field element")
})
})
.collect::<Result<Vec<_>, _>>()
.map(Self::new)
let values: Vec<Felt> = iter.into_iter().map(Felt::from).collect();
Ok(Self::new(values))
}

// PUBLIC ACCESSORS
Expand Down
9 changes: 1 addition & 8 deletions processor/src/host/advice/inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ impl AdviceInputs {
where
I: IntoIterator<Item = u64>,
{
let stack = iter
.into_iter()
.map(|v| {
Felt::try_from(v).map_err(|_| {
InputError::NotFieldElement(v, "the provided value isn't a valid field element")
})
})
.collect::<Result<Vec<_>, _>>()?;
let stack = iter.into_iter().map(Felt::from);
self.stack.extend(stack);
Ok(self)
}
Expand Down

0 comments on commit 8fbc2ab

Please sign in to comment.