Skip to content

Commit

Permalink
DFGBuilder::new(_fn=>)
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed Jun 24, 2024
1 parent 1fd74df commit 7b70f00
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hugr-core/src/builder/dataflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl DFGBuilder<Hugr> {

/// Begin building a new DFG-rooted HUGR given its inputs and outputs;
/// extension delta will be inferred.
pub fn new_fn(
pub fn new(
inputs: impl Into<TypeRow>,
outputs: impl Into<TypeRow>,
) -> Result<DFGBuilder<Hugr>, BuildError> {
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/hugr/rewrite/inline_dfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ mod test {
.unwrap();
let int_ty = &int_types::INT_TYPES[6];

let mut outer = DFGBuilder::new_fn(vec![int_ty.clone(); 2], vec![int_ty.clone()])?;
let mut outer = DFGBuilder::new(vec![int_ty.clone(); 2], vec![int_ty.clone()])?;
let [a, b] = outer.input_wires_arr();
fn make_const<T: AsMut<Hugr> + AsRef<Hugr>>(
d: &mut DFGBuilder<T>,
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/hugr/serialize/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ fn hierarchy_order() -> Result<(), Box<dyn std::error::Error>> {

#[test]
fn constants_roundtrip() -> Result<(), Box<dyn std::error::Error>> {
let mut builder = DFGBuilder::new_fn(vec![], vec![INT_TYPES[4].clone()]).unwrap();
let mut builder = DFGBuilder::new(vec![], vec![INT_TYPES[4].clone()]).unwrap();
let w = builder.add_load_value(ConstInt::new_s(4, -2).unwrap());
let hugr = builder.finish_hugr_with_outputs([w], &INT_OPS_REGISTRY)?;

Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/hugr/validate/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ fn test_polymorphic_call() -> Result<(), Box<dyn std::error::Error>> {

let int_pair = Type::new_tuple(type_row![USIZE_T; 2]);
// Root DFG: applies a function int--PRELUDE-->int to each element of a pair of two ints
let mut d = DFGBuilder::new_fn(
let mut d = DFGBuilder::new(
vec![utou(PRELUDE_ID), int_pair.clone()],
vec![int_pair.clone()],
)?;
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/hugr/views/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fn value_types() {
fn static_targets() {
use crate::extension::prelude::{ConstUsize, USIZE_T};
use itertools::Itertools;
let mut dfg = DFGBuilder::new_fn(type_row![], type_row![USIZE_T]).unwrap();
let mut dfg = DFGBuilder::new(type_row![], type_row![USIZE_T]).unwrap();

let c = dfg.add_constant(Value::extension(ConstUsize::new(1)));

Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/ops/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ mod test {
let pred_rows = vec![type_row![USIZE_T, FLOAT64_TYPE], Type::EMPTY_TYPEROW];
let pred_ty = SumType::new(pred_rows.clone());

let mut b = DFGBuilder::new_fn(type_row![], TypeRow::from(vec![pred_ty.clone().into()]))?;
let mut b = DFGBuilder::new(type_row![], TypeRow::from(vec![pred_ty.clone().into()]))?;
let c = b.add_constant(Value::sum(
0,
[
Expand Down
2 changes: 1 addition & 1 deletion hugr-passes/src/const_fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub fn fold_leaf_op(op: &OpType, consts: &[(IncomingPort, Value)]) -> ConstFoldR
/// against `reg`.
fn const_graph(consts: Vec<Value>, reg: &ExtensionRegistry) -> Hugr {
let const_types = consts.iter().map(Value::get_type).collect_vec();
let mut b = DFGBuilder::new_fn(type_row![], const_types).unwrap();
let mut b = DFGBuilder::new(type_row![], const_types).unwrap();

let outputs = consts
.into_iter()
Expand Down

0 comments on commit 7b70f00

Please sign in to comment.