From 759c8a7d385ef09fa734eee0b276b4b268456b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Mon, 9 Dec 2024 16:39:58 +0000 Subject: [PATCH] Use `if cfg!(..) instead of #[cfg(...)] --- hugr-core/src/hugr/validate.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hugr-core/src/hugr/validate.rs b/hugr-core/src/hugr/validate.rs index dd048bb3f..663253e1a 100644 --- a/hugr-core/src/hugr/validate.rs +++ b/hugr-core/src/hugr/validate.rs @@ -40,8 +40,9 @@ impl Hugr { /// variables (see github issue #457) pub fn validate(&self) -> Result<(), ValidationError> { self.validate_no_extensions()?; - #[cfg(feature = "extension_inference")] - self.validate_extensions()?; + if cfg!(feature = "extension_inference") { + self.validate_extensions()?; + } Ok(()) }