Parcourir la source

fix: is_some_and is an unstable Rust feature until 1.70

Robert Minsk il y a 2 ans
Parent
commit
25d5ddd5a0
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  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
     }
     }