Skip to content

Commit

Permalink
refactor: removed redundant cfg blocks (#27)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lukecarr authored Apr 26, 2024
1 parent 7318783 commit 37d1c20
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions crates/subtale-mimir/src/float.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#[cfg(feature = "float")]
use float_cmp::approx_eq;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -40,7 +37,6 @@ pub enum FloatEvaluator {
InRange(FloatRangeBound, FloatRangeBound),
}

#[cfg(feature = "float")]
impl Evaluator<f64> for FloatEvaluator {
fn evaluate(self, value: f64) -> bool {
match self {
Expand Down Expand Up @@ -72,7 +68,6 @@ impl Evaluator<f64> for FloatEvaluator {
}
}

#[cfg(feature = "float")]
impl FloatEvaluator {
/// Utility function for composing an instance of `FloatEvaluator` that
/// checks for values less than `value`.
Expand Down

0 comments on commit 37d1c20

Please sign in to comment.