Skip to content

Commit

Permalink
Made Range PartialEq and PartialOrd.
Browse files Browse the repository at this point in the history
  • Loading branch information
metasim authored and bastibl committed Nov 7, 2024
1 parent 0d2df55 commit 33df5b6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ use serde::Serialize;

/// Component of a [Range].
///
/// Can be an interval or an individual value.
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A [RangeItem] can be an interval, a fixed value, or a step interval.
#[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)]
pub enum RangeItem {
/// Interval (inclusive).
/// Min/max interval (inclusive).
Interval(f64, f64),
/// Exact value.
/// Exact, fixed value.
Value(f64),
/// Step
/// Min/max/skip intervals.
Step(f64, f64, f64),
}

/// Range of possible values, comprised of individual values and/or intervals.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Range {
pub items: Vec<RangeItem>,
}
Expand Down

0 comments on commit 33df5b6

Please sign in to comment.