rust_toolchain/channel/
nightly.rs

1use crate::Date;
2
3/// The `Nightly` release [`channel`]
4///
5/// [`channel`]: https://rust-lang.github.io/rustup/concepts/channels.html
6#[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
7pub struct Nightly {
8    /// A short YYYY-MM-DD associated date
9    pub date: Date,
10}
11
12#[cfg(test)]
13mod tests {
14    use crate::{channel::Nightly, Date};
15
16    #[yare::parameterized(
17        patch1 = { Date::new(0, 0, 0), Date::new(0, 0, 1) },
18        minor1 = { Date::new(0, 0, 0), Date::new(0, 1, 0) },
19        major1 = { Date::new(0, 0, 0), Date::new(1, 0, 0) },
20        minor_over_patch = { Date::new(0, 0, 99), Date::new(0, 1, 0) },
21        major_over_patch = { Date::new(0, 0, 99), Date::new(1, 0, 0) },
22        major_over_minor = { Date::new(0, 99, 0), Date::new(1, 0, 0) },
23    )]
24    fn ord(left: Date, right: Date) {
25        let left = Nightly { date: left };
26        let right = Nightly { date: right };
27
28        assert!(left < right);
29    }
30}