Преглед изворни кода

docs: Document is_empty_dir functions

Robert Minsk пре 2 година
родитељ
комит
1a947b77d1
1 измењених фајлова са 6 додато и 5 уклоњено
  1. 6 5
      src/fs/file.rs

+ 6 - 5
src/fs/file.rs

@@ -441,14 +441,15 @@ impl<'dir> File<'dir> {
         }
     }
 
-    // To display icons for empty folders.
     /// Determines if the directory is empty or not.
     ///
     /// For Unix platforms, this function first checks the link count to quickly 
-    /// determine non-empty directories. If the link count is less than or equal to 2,
-    /// it then checks the directory contents to determine if it's truly empty.
-    /// The naive approach used here checks the contents directly, as certain filesystems 
-    /// make it difficult to infer emptiness based on directory size alone.
+    /// determine non-empty directories. On most UNIX filesystems the link count
+    /// is two plus the number of subdirectories. If the link count is less than
+    /// or equal to 2, it then checks the directory contents to determine if
+    /// it's truly empty. The naive approach used here checks the contents
+    /// directly, as certain filesystems make it difficult to infer emptiness
+    /// based on directory size alone.
     #[cfg(unix)]
     pub fn is_empty_dir(&self) -> bool {
         if self.is_directory() {