aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/build_common.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-06-29 22:37:11 +0200
committerDario Nieuwenhuis <[email protected]>2025-07-04 00:23:22 +0200
commit72248a601a9ea28ac696f186e2cbe4c2f128a133 (patch)
tree109eca1e791766d62237056f9fa4a5a37a7b9d63 /embassy-executor/build_common.rs
parentb964bee302fc3631d14d73d9a9b406e7352cd550 (diff)
Update Rust nightly, stable.
Diffstat (limited to 'embassy-executor/build_common.rs')
-rw-r--r--embassy-executor/build_common.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/embassy-executor/build_common.rs b/embassy-executor/build_common.rs
index b15a8369f..4f24e6d37 100644
--- a/embassy-executor/build_common.rs
+++ b/embassy-executor/build_common.rs
@@ -92,35 +92,3 @@ pub fn set_target_cfgs(cfgs: &mut CfgSet) {
92 92
93 cfgs.set("has_fpu", target.ends_with("-eabihf")); 93 cfgs.set("has_fpu", target.ends_with("-eabihf"));
94} 94}
95
96#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
97pub struct CompilerDate {
98 year: u16,
99 month: u8,
100 day: u8,
101}
102
103impl CompilerDate {
104 fn parse(date: &str) -> Option<Self> {
105 let mut parts = date.split('-');
106 let year = parts.next()?.parse().ok()?;
107 let month = parts.next()?.parse().ok()?;
108 let day = parts.next()?.parse().ok()?;
109 Some(Self { year, month, day })
110 }
111}
112
113impl PartialEq<&str> for CompilerDate {
114 fn eq(&self, other: &&str) -> bool {
115 let Some(other) = Self::parse(other) else {
116 return false;
117 };
118 self.eq(&other)
119 }
120}
121
122impl PartialOrd<&str> for CompilerDate {
123 fn partial_cmp(&self, other: &&str) -> Option<std::cmp::Ordering> {
124 Self::parse(other).map(|other| self.cmp(&other))
125 }
126}