Przeglądaj źródła

style: is_empty_dir() was put between the unix size() and windows size()

Robert Minsk 2 lat temu
rodzic
commit
a18c21b75d
1 zmienionych plików z 10 dodań i 10 usunięć
  1. 10 10
      src/fs/file.rs

+ 10 - 10
src/fs/file.rs

@@ -427,6 +427,16 @@ impl<'dir> File<'dir> {
         }
         }
     }
     }
 
 
+    #[cfg(windows)]
+    pub fn size(&self) -> f::Size {
+        if self.is_directory() {
+            f::Size::None
+        }
+        else {
+            f::Size::Some(self.metadata.len())
+        }
+    }
+
     // To display icons for empty folders.
     // To display icons for empty folders.
     #[cfg(unix)]
     #[cfg(unix)]
     pub fn is_empty_dir(&self) -> bool {
     pub fn is_empty_dir(&self) -> bool {
@@ -466,16 +476,6 @@ impl<'dir> File<'dir> {
         }
         }
     }
     }
 
 
-    #[cfg(windows)]
-    pub fn size(&self) -> f::Size {
-        if self.is_directory() {
-            f::Size::None
-        }
-        else {
-            f::Size::Some(self.metadata.len())
-        }
-    }
-
     /// This file’s last modified timestamp, if available on this platform.
     /// This file’s last modified timestamp, if available on this platform.
     pub fn modified_time(&self) -> Option<SystemTime> {
     pub fn modified_time(&self) -> Option<SystemTime> {
         if self.is_link() && self.deref_links {
         if self.is_link() && self.deref_links {