From 37d1c205d34ffbfe647ad1fcb2906ade1ff47721 Mon Sep 17 00:00:00 2001 From: Luke Carr Date: Sat, 27 Apr 2024 00:04:57 +0100 Subject: [PATCH] refactor: removed redundant `cfg` blocks (#27) The `#[cfg(feature = "float")]` statements in the `float.rs` module were redundant because the entire `pub mod float;` statement in `lib.rs` is already gated behind the `float` feature flag. --- crates/subtale-mimir/src/float.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/crates/subtale-mimir/src/float.rs b/crates/subtale-mimir/src/float.rs index b545daa..c4ed25b 100644 --- a/crates/subtale-mimir/src/float.rs +++ b/crates/subtale-mimir/src/float.rs @@ -1,4 +1,3 @@ -#[cfg(feature = "float")] use float_cmp::approx_eq; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; @@ -8,7 +7,6 @@ use super::evaluator::Evaluator; /// Represents a bound of a range used during float comparisons made by /// `FloatEvaluator`. #[derive(Clone, Copy, Debug, PartialEq)] -#[cfg(feature = "float")] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum FloatRangeBound { /// A bound that's exclusive of the contained value. @@ -20,7 +18,6 @@ pub enum FloatRangeBound { /// A reference implementation of the `Evaluator` trait that allows for /// comparisons against facts with a value type of `f64`. #[derive(Clone, Copy, Debug, PartialEq)] -#[cfg(feature = "float")] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum FloatEvaluator { /// Checks if a fact has a specific `f64` value (using the `float_cmp` crate @@ -40,7 +37,6 @@ pub enum FloatEvaluator { InRange(FloatRangeBound, FloatRangeBound), } -#[cfg(feature = "float")] impl Evaluator for FloatEvaluator { fn evaluate(self, value: f64) -> bool { match self { @@ -72,7 +68,6 @@ impl Evaluator for FloatEvaluator { } } -#[cfg(feature = "float")] impl FloatEvaluator { /// Utility function for composing an instance of `FloatEvaluator` that /// checks for values less than `value`.