Skip to content

Commit 07e5b39

Browse files
committed
Derive PartialOrd for time module types
Derive PartialOrd for Bps Derive PartialOrd for Hertz Derive PartialOrd for KiloHertz Derive PartialOrd for MegaHertz
1 parent afd8087 commit 07e5b39

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/time.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use cortex_m::peripheral::{DCB, DWT};
3333
use crate::rcc::Clocks;
3434

3535
/// Bits per second
36-
#[derive(Clone, Copy, PartialEq, Debug)]
36+
#[derive(Clone, Copy, PartialEq, PartialOrd, Debug)]
3737
pub struct Bps(pub u32);
3838

3939
/// Hertz
@@ -52,7 +52,7 @@ pub struct Bps(pub u32);
5252
///
5353
/// let freq = 60.hz();
5454
/// ```
55-
#[derive(Clone, Copy, PartialEq, Debug)]
55+
#[derive(Clone, Copy, PartialEq, PartialOrd, Debug)]
5656
pub struct Hertz(pub u32);
5757

5858
/// Kilohertz
@@ -74,7 +74,7 @@ pub struct Hertz(pub u32);
7474
///
7575
/// let freq = 100.khz();
7676
/// ```
77-
#[derive(Clone, Copy, PartialEq, Debug)]
77+
#[derive(Clone, Copy, PartialEq, PartialOrd, Debug)]
7878
pub struct KiloHertz(pub u32);
7979

8080
/// Megahertz
@@ -95,7 +95,7 @@ pub struct KiloHertz(pub u32);
9595
///
9696
/// let freq = 8.mhz();
9797
/// ```
98-
#[derive(Clone, Copy, PartialEq, Debug)]
98+
#[derive(Clone, Copy, PartialEq, PartialOrd, Debug)]
9999
pub struct MegaHertz(pub u32);
100100

101101
/// Time unit

0 commit comments

Comments
 (0)