Skip to content

Commit eff6693

Browse files
committed
new_default -> new_auto
1 parent 6b0249d commit eff6693

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/builder/build_traits.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub trait Dataflow: Container {
200200
op: impl Into<OpType>,
201201
input_wires: impl IntoIterator<Item = Wire>,
202202
) -> Result<BuildHandle<DataflowOpID>, BuildError> {
203-
self.add_dataflow_node(NodeType::new_default(op), input_wires)
203+
self.add_dataflow_node(NodeType::new_auto(op), input_wires)
204204
}
205205

206206
/// Add a dataflow [`NodeType`] to the sibling graph, wiring up the `input_wires` to the
@@ -628,7 +628,7 @@ fn add_op_with_wires<T: Dataflow + ?Sized>(
628628
optype: impl Into<OpType>,
629629
inputs: Vec<Wire>,
630630
) -> Result<(Node, usize), BuildError> {
631-
add_node_with_wires(data_builder, NodeType::new_default(optype), inputs)
631+
add_node_with_wires(data_builder, NodeType::new_auto(optype), inputs)
632632
}
633633

634634
fn add_node_with_wires<T: Dataflow + ?Sized>(

src/hugr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl NodeType {
100100

101101
/// Instantiate an [OpType] with the default set of input extensions
102102
/// for that OpType.
103-
pub fn new_default(op: impl Into<OpType>) -> Self {
103+
pub fn new_auto(op: impl Into<OpType>) -> Self {
104104
let op = op.into();
105105
if OpTag::ModuleOp.is_superset(op.tag()) {
106106
Self::new_closed(op)
@@ -248,7 +248,7 @@ impl Hugr {
248248

249249
/// Add a node to the graph, with the default conversion from OpType to NodeType
250250
pub(crate) fn add_op(&mut self, op: impl Into<OpType>) -> Node {
251-
self.add_node(NodeType::new_default(op))
251+
self.add_node(NodeType::new_auto(op))
252252
}
253253

254254
/// Add a node to the graph.

src/hugr/hugrmut.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub trait HugrMut: HugrMutInternals {
3737
parent: Node,
3838
op: impl Into<OpType>,
3939
) -> Result<Node, HugrError> {
40-
self.add_node_with_parent(parent, NodeType::new_default(op))
40+
self.add_node_with_parent(parent, NodeType::new_auto(op))
4141
}
4242

4343
/// Add a node to the graph with a parent in the hierarchy.
@@ -217,7 +217,7 @@ impl<T: RootTagged<RootHandle = Node> + AsMut<Hugr>> HugrMut for T {
217217
}
218218

219219
fn add_op_before(&mut self, sibling: Node, op: impl Into<OpType>) -> Result<Node, HugrError> {
220-
self.add_node_before(sibling, NodeType::new_default(op))
220+
self.add_node_before(sibling, NodeType::new_auto(op))
221221
}
222222

223223
fn add_node_before(&mut self, sibling: Node, nodetype: NodeType) -> Result<Node, HugrError> {

0 commit comments

Comments
 (0)