Ver código fonte

Merge pull request #304 from cfxegbert/bad-symlinks-is-some-and-fix

fix: is_some_and is an unstable Rust feature until 1.70
Preston Thorpe 2 anos atrás
pai
commit
02080fc3f5
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      src/fs/file.rs

+ 4 - 1
src/fs/file.rs

@@ -254,7 +254,10 @@ impl<'dir> File<'dir> {
     /// Whether this file is a mount point
     /// Whether this file is a mount point
     pub fn is_mount_point(&self) -> bool {
     pub fn is_mount_point(&self) -> bool {
         if cfg!(target_os = "linux") && self.is_directory() {
         if cfg!(target_os = "linux") && self.is_directory() {
-            return self.absolute_path.as_ref().is_some_and(|p|ALL_MOUNTS.contains_key(p));
+            return match self.absolute_path.as_ref() {
+                Some(path) => ALL_MOUNTS.contains_key(path),
+                None => false,
+            }
         }
         }
         false
         false
     }
     }