Remove "no-std" feature checks
[rust-lightning] / lightning / src / util / time.rs
index 0d969e7470952625d8db04965220c25df589f30f..a6e6f4d1fda6b6e58a102a0baeb97cbed102159f 100644 (file)
@@ -59,15 +59,15 @@ impl Sub<Duration> for Eternity {
 }
 
 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
-#[cfg(not(feature = "no-std"))]
+#[cfg(feature = "std")]
 pub struct MonotonicTime(std::time::Instant);
 
 /// The amount of time to shift `Instant` forward to prevent overflow when subtracting a `Duration`
 /// from `Instant::now` on some operating systems (e.g., iOS representing `Instance` as `u64`).
-#[cfg(not(feature = "no-std"))]
+#[cfg(feature = "std")]
 const SHIFT: Duration = Duration::from_secs(10 * 365 * 24 * 60 * 60); // 10 years.
 
-#[cfg(not(feature = "no-std"))]
+#[cfg(feature = "std")]
 impl Time for MonotonicTime {
        fn now() -> Self {
                let instant = std::time::Instant::now().checked_add(SHIFT).expect("Overflow on MonotonicTime instantiation");
@@ -93,7 +93,7 @@ impl Time for MonotonicTime {
        }
 }
 
-#[cfg(not(feature = "no-std"))]
+#[cfg(feature = "std")]
 impl Sub<Duration> for MonotonicTime {
        type Output = Self;
 
@@ -177,7 +177,7 @@ pub mod tests {
        }
 
        #[test]
-       #[cfg(not(feature = "no-std"))]
+       #[cfg(feature = "std")]
        fn monotonic_time_subtracts() {
                let now = super::MonotonicTime::now();
                assert!(now.elapsed() < Duration::from_secs(10));