Procházet zdrojové kódy

fix: build for Windows with chrono

Steven Davies před 2 roky
rodič
revize
840b4c5834
2 změnil soubory, kde provedl 2 přidání a 28 odebrání
  1. 1 1
      src/fs/file.rs
  2. 1 27
      src/output/table.rs

+ 1 - 1
src/fs/file.rs

@@ -561,7 +561,7 @@ impl<'dir> File<'dir> {
     }
     }
 
 
     #[cfg(windows)]
     #[cfg(windows)]
-    pub fn changed_time(&self) -> Option<SystemTime> {
+    pub fn changed_time(&self) -> Option<NaiveDateTime> {
         self.modified_time()
         self.modified_time()
     }
     }
 
 

+ 1 - 27
src/output/table.rs

@@ -357,36 +357,10 @@ impl Environment {
         #[cfg(unix)]
         #[cfg(unix)]
         let users = Mutex::new(UsersCache::new());
         let users = Mutex::new(UsersCache::new());
 
 
-        Self { time_offset, numeric, users }
+        Self { time_offset, numeric, #[cfg(unix)] users }
     }
     }
 }
 }
 
 
-#[allow(clippy::unnecessary_wraps)] // Needs to match Unix function
-#[cfg(windows)]
-fn determine_time_zone() -> TZResult<TimeZone> {
-    use datetime::zone::{FixedTimespan, FixedTimespanSet, StaticTimeZone, TimeZoneSource};
-    use std::borrow::Cow;
-
-    Ok(TimeZone(TimeZoneSource::Static(&StaticTimeZone {
-        name: "Unsupported",
-        fixed_timespans: FixedTimespanSet {
-            first: FixedTimespan {
-                offset: 0,
-                is_dst: false,
-                name: Cow::Borrowed("ZONE_A"),
-            },
-            rest: &[(
-                1_206_838_800, // Sun Mar 30 2008 01:00:00 GMT+0000
-                FixedTimespan {
-                    offset: 3600,
-                    is_dst: false,
-                    name: Cow::Borrowed("ZONE_B"),
-                },
-            )],
-        },
-    })))
-}
-
 lazy_static! {
 lazy_static! {
     static ref ENVIRONMENT: Environment = Environment::load_all();
     static ref ENVIRONMENT: Environment = Environment::load_all();
 }
 }