From 112b28d2ded65a86310664d677029e29ba313f97 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Wed, 18 Dec 2024 12:44:05 +0000 Subject: [PATCH] review comments --- hugr-passes/src/lib.rs | 2 +- hugr-passes/src/monomorphize.rs | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hugr-passes/src/lib.rs b/hugr-passes/src/lib.rs index c7a9c461a..55e058047 100644 --- a/hugr-passes/src/lib.rs +++ b/hugr-passes/src/lib.rs @@ -14,7 +14,7 @@ mod monomorphize; )] #[allow(deprecated)] pub use monomorphize::monomorphize; -pub use monomorphize::{remove_polyfuncs, MonomorphizePass}; +pub use monomorphize::{remove_polyfuncs, MonomorphizeError, MonomorphizePass}; pub mod nest_cfgs; pub mod non_local; pub mod validation; diff --git a/hugr-passes/src/monomorphize.rs b/hugr-passes/src/monomorphize.rs index ee1d8557c..8686d10b0 100644 --- a/hugr-passes/src/monomorphize.rs +++ b/hugr-passes/src/monomorphize.rs @@ -33,17 +33,9 @@ use thiserror::Error; since = "0.14.1", note = "Use `hugr::algorithms::MonomorphizePass` instead." )] -// TODO: Deprecated. Remove on a breaking release. +// TODO: Deprecated. Remove on a breaking release and rename private `monomorphize_ref` to `monomorphize`. pub fn monomorphize(mut h: Hugr) -> Hugr { - let validate = |h: &Hugr| h.validate().unwrap_or_else(|e| panic!("{e}")); - - #[cfg(debug_assertions)] - validate(&h); - monomorphize_ref(&mut h); - - #[cfg(debug_assertions)] - validate(&h); h }