Chester Liu 4 gadi atpakaļ
vecāks
revīzija
13b3635407
3 mainītis faili ar 1 papildinājumiem un 8 dzēšanām
  1. 1 3
      src/fs/file.rs
  2. 0 2
      src/fs/filter.rs
  3. 0 3
      src/options/filter.rs

+ 1 - 3
src/fs/file.rs

@@ -594,10 +594,8 @@ mod filename_test {
     }
     }
 
 
     #[test]
     #[test]
+    #[cfg(unix)]
     fn topmost() {
     fn topmost() {
-        #[cfg(unix)]
         assert_eq!("/", File::filename(Path::new("/")));
         assert_eq!("/", File::filename(Path::new("/")));
-        #[cfg(windows)]
-        assert_eq!("C:\\", File::filename(Path::new("C:\\")));
     }
     }
 }
 }

+ 0 - 2
src/fs/filter.rs

@@ -185,7 +185,6 @@ pub enum SortField {
     ///
     ///
     /// In original Unix, this was, however, meant as creation time.
     /// In original Unix, this was, however, meant as creation time.
     /// https://www.bell-labs.com/usr/dmr/www/cacm.html
     /// https://www.bell-labs.com/usr/dmr/www/cacm.html
-    #[cfg(unix)]
     ChangedDate,
     ChangedDate,
 
 
     /// The time the file was created (the “btime” or “birthtime”).
     /// The time the file was created (the “btime” or “birthtime”).
@@ -257,7 +256,6 @@ impl SortField {
             Self::FileInode     => a.metadata.ino().cmp(&b.metadata.ino()),
             Self::FileInode     => a.metadata.ino().cmp(&b.metadata.ino()),
             Self::ModifiedDate  => a.modified_time().cmp(&b.modified_time()),
             Self::ModifiedDate  => a.modified_time().cmp(&b.modified_time()),
             Self::AccessedDate  => a.accessed_time().cmp(&b.accessed_time()),
             Self::AccessedDate  => a.accessed_time().cmp(&b.accessed_time()),
-            #[cfg(unix)]
             Self::ChangedDate   => a.changed_time().cmp(&b.changed_time()),
             Self::ChangedDate   => a.changed_time().cmp(&b.changed_time()),
             Self::CreatedDate   => a.created_time().cmp(&b.created_time()),
             Self::CreatedDate   => a.created_time().cmp(&b.created_time()),
             Self::ModifiedAge   => b.modified_time().cmp(&a.modified_time()),  // flip b and a
             Self::ModifiedAge   => b.modified_time().cmp(&a.modified_time()),  // flip b and a

+ 0 - 3
src/options/filter.rs

@@ -78,15 +78,12 @@ impl SortField {
             "age" | "old" | "oldest" => {
             "age" | "old" | "oldest" => {
                 Self::ModifiedAge
                 Self::ModifiedAge
             }
             }
-            #[cfg(unix)]
             "ch" | "changed" => {
             "ch" | "changed" => {
                 Self::ChangedDate
                 Self::ChangedDate
             }
             }
-            #[cfg(unix)]
             "acc" | "accessed" => {
             "acc" | "accessed" => {
                 Self::AccessedDate
                 Self::AccessedDate
             }
             }
-            #[cfg(unix)]
             "cr" | "created" => {
             "cr" | "created" => {
                 Self::CreatedDate
                 Self::CreatedDate
             }
             }