aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/build_common.rs
diff options
context:
space:
mode:
author1-rafael-1 <[email protected]>2025-09-15 20:07:18 +0200
committer1-rafael-1 <[email protected]>2025-09-15 20:07:18 +0200
commit6bb3d2c0720fa082f27d3cdb70f516058497ec87 (patch)
tree5a1e255cff999b00800f203b91a759c720c973e5 /embassy-executor/build_common.rs
parenteb685574601d98c44faed9a3534d056199b46e20 (diff)
parent92a6fd2946f2cbb15359290f68aa360953da2ff7 (diff)
Merge branch 'main' into rp2040-rtc-alarm
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}