diff --git a/src/builder/build_traits.rs b/src/builder/build_traits.rs index 3a122eb8b..950a85903 100644 --- a/src/builder/build_traits.rs +++ b/src/builder/build_traits.rs @@ -200,7 +200,7 @@ pub trait Dataflow: Container { op: impl Into, input_wires: impl IntoIterator, ) -> Result, BuildError> { - self.add_dataflow_node(NodeType::new_default(op), input_wires) + self.add_dataflow_node(NodeType::new_auto(op), input_wires) } /// Add a dataflow [`NodeType`] to the sibling graph, wiring up the `input_wires` to the @@ -628,7 +628,7 @@ fn add_op_with_wires( optype: impl Into, inputs: Vec, ) -> Result<(Node, usize), BuildError> { - add_node_with_wires(data_builder, NodeType::new_default(optype), inputs) + add_node_with_wires(data_builder, NodeType::new_auto(optype), inputs) } fn add_node_with_wires( diff --git a/src/hugr.rs b/src/hugr.rs index deccdada1..128eee522 100644 --- a/src/hugr.rs +++ b/src/hugr.rs @@ -100,7 +100,7 @@ impl NodeType { /// Instantiate an [OpType] with the default set of input extensions /// for that OpType. - pub fn new_default(op: impl Into) -> Self { + pub fn new_auto(op: impl Into) -> Self { let op = op.into(); if OpTag::ModuleOp.is_superset(op.tag()) { Self::new_pure(op) @@ -248,7 +248,7 @@ impl Hugr { /// Add a node to the graph, with the default conversion from OpType to NodeType pub(crate) fn add_op(&mut self, op: impl Into) -> Node { - self.add_node(NodeType::new_default(op)) + self.add_node(NodeType::new_auto(op)) } /// Add a node to the graph. diff --git a/src/hugr/hugrmut.rs b/src/hugr/hugrmut.rs index 7e066d1cb..3e1ef81dc 100644 --- a/src/hugr/hugrmut.rs +++ b/src/hugr/hugrmut.rs @@ -37,7 +37,7 @@ pub trait HugrMut: HugrMutInternals { parent: Node, op: impl Into, ) -> Result { - self.add_node_with_parent(parent, NodeType::new_default(op)) + self.add_node_with_parent(parent, NodeType::new_auto(op)) } /// Add a node to the graph with a parent in the hierarchy. @@ -217,7 +217,7 @@ impl + AsMut> HugrMut for T { } fn add_op_before(&mut self, sibling: Node, op: impl Into) -> Result { - self.add_node_before(sibling, NodeType::new_default(op)) + self.add_node_before(sibling, NodeType::new_auto(op)) } fn add_node_before(&mut self, sibling: Node, nodetype: NodeType) -> Result {