--- .home/.cargo/macports/time-macros-impl-0.1.1/src/ext.rs	2020-04-20 10:59:45.000000000 +0800
+++ .home/.cargo/macports/time-macros-impl-0.1.1/src/ext.rs	2026-01-05 23:49:39.000000000 +0800
@@ -29,7 +29,26 @@
 
     #[allow(unstable_name_collisions)]
     fn ensure_in_range(&self, range: impl RangeBounds<isize> + Debug) -> Result<()> {
-        if range.contains(&self.value()?) {
+        use std::ops::Bound;
+    
+        let val: isize = match self.base10_parse() {
+            Ok(value) => value,
+            Err(e) => return error!(self.span(), "{}", e),
+        };
+    
+        let in_range = match range.start_bound() {
+            Bound::Included(&start) if val < start => false,
+            Bound::Excluded(&start) if val <= start => false,
+            Bound::Unbounded => true,
+            _ => match range.end_bound() {
+                Bound::Included(&end) if val > end => false,
+                Bound::Excluded(&end) if val >= end => false,
+                Bound::Unbounded => true,
+                _ => true,
+            }
+        };
+    
+        if in_range {
             Ok(())
         } else {
             error!(self.span(), "value must be in range {:?}", range)
