Skip to content

Commit

Permalink
Use Fn trait instead of FnMut for callback
Browse files Browse the repository at this point in the history
We don't need the callback to be mutable currently so relax the trait to
just be `Fn` instead of `FnMut`. If we have a need for a mutable
environment callback in the future we can change this easily enough
without any issues.
  • Loading branch information
mtreinish committed Sep 9, 2024
1 parent 7b0e363 commit 2ff94f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/circuit/src/dag_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6292,10 +6292,10 @@ impl DAGCircuit {
&mut self,
py: Python, // Unused if cache_pygates isn't enabled
node: NodeIndex,
mut insert: F,
insert: F,
) -> PyResult<()>
where
F: FnMut(&Wire) -> PyResult<OperationFromPython>,
F: Fn(&Wire) -> PyResult<OperationFromPython>,
{
let edges: Vec<(NodeIndex, EdgeIndex, Wire)> = self
.dag
Expand Down

0 comments on commit 2ff94f5

Please sign in to comment.