From 047c3a031c63d19a0be39523d30f083b03db56db Mon Sep 17 00:00:00 2001 From: Douglas Wilson Date: Wed, 24 Apr 2024 15:39:10 +0100 Subject: [PATCH] use Const::const_type() --- hugr/src/builder/build_traits.rs | 2 +- hugr/src/ops/constant.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hugr/src/builder/build_traits.rs b/hugr/src/builder/build_traits.rs index a49c73ddf4..e2951dfae1 100644 --- a/hugr/src/builder/build_traits.rs +++ b/hugr/src/builder/build_traits.rs @@ -358,7 +358,7 @@ pub trait Dataflow: Container { let load_n = self .add_dataflow_op( ops::LoadConstant { - datatype: op.value().const_type().clone(), + datatype: op.const_type().clone(), }, // Constant wire from the constant value node vec![Wire::new(const_node, OutgoingPort::from(0))], diff --git a/hugr/src/ops/constant.rs b/hugr/src/ops/constant.rs index e3678e95c9..8a434ec7a1 100644 --- a/hugr/src/ops/constant.rs +++ b/hugr/src/ops/constant.rs @@ -34,7 +34,7 @@ impl Const { pub fn value(&self) -> &Value { &self.value } - + /// Returns a reference to the type of this constant. pub fn const_type(&self) -> Type { self.value.const_type() @@ -321,7 +321,7 @@ impl OpTrait for Const { } fn static_output(&self) -> Option { - Some(EdgeKind::Const(self.value().const_type())) + Some(EdgeKind::Const(self.const_type())) } }