Skip to content

Commit

Permalink
new_default -> new_auto
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed Nov 1, 2023
1 parent dbf29b4 commit 740c394
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/builder/build_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub trait Dataflow: Container {
op: impl Into<OpType>,
input_wires: impl IntoIterator<Item = Wire>,
) -> Result<BuildHandle<DataflowOpID>, 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
Expand Down Expand Up @@ -628,7 +628,7 @@ fn add_op_with_wires<T: Dataflow + ?Sized>(
optype: impl Into<OpType>,
inputs: Vec<Wire>,
) -> 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<T: Dataflow + ?Sized>(
Expand Down
4 changes: 2 additions & 2 deletions src/hugr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<OpType>) -> Self {
pub fn new_auto(op: impl Into<OpType>) -> Self {
let op = op.into();
if OpTag::ModuleOp.is_superset(op.tag()) {
Self::new_pure(op)
Expand Down Expand Up @@ -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<OpType>) -> Node {
self.add_node(NodeType::new_default(op))
self.add_node(NodeType::new_auto(op))
}

/// Add a node to the graph.
Expand Down
4 changes: 2 additions & 2 deletions src/hugr/hugrmut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub trait HugrMut: HugrMutInternals {
parent: Node,
op: impl Into<OpType>,
) -> Result<Node, HugrError> {
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.
Expand Down Expand Up @@ -217,7 +217,7 @@ impl<T: RootTagged<RootHandle = Node> + AsMut<Hugr>> HugrMut for T {
}

fn add_op_before(&mut self, sibling: Node, op: impl Into<OpType>) -> Result<Node, HugrError> {
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<Node, HugrError> {
Expand Down

0 comments on commit 740c394

Please sign in to comment.