Skip to content

Commit

Permalink
Refactor: add_from_iter is now called extend to stick with Rust
Browse files Browse the repository at this point in the history
… nomenclature.
  • Loading branch information
raynelfss committed Sep 4, 2024
1 parent dcf674b commit 3cb950e
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 @@ -4350,7 +4350,7 @@ def _format(operand):

let mut new_layer = self.copy_empty_like(py, vars_mode)?;

new_layer.add_from_iter(py, op_nodes.iter().map(|(inst, _)| (*inst).clone()))?;
new_layer.extend(py, op_nodes.iter().map(|(inst, _)| (*inst).clone()))?;

let new_layer_op_nodes = new_layer.op_nodes(false).filter_map(|node_index| {
match new_layer.dag.node_weight(node_index) {
Expand Down Expand Up @@ -6347,7 +6347,7 @@ impl DAGCircuit {
}

/// Adds valid instances of [PackedInstruction] to the back of the Circuit.
pub fn add_from_iter<I>(&mut self, py: Python, iter: I) -> PyResult<Vec<NodeIndex>>
pub fn extend<I>(&mut self, py: Python, iter: I) -> PyResult<Vec<NodeIndex>>
where
I: IntoIterator<Item = PackedInstruction>,
{
Expand Down

0 comments on commit 3cb950e

Please sign in to comment.