Explorar o código

fix: is_some_and is an unstable Rust feature until 1.70

Robert Minsk %!s(int64=2) %!d(string=hai) anos
pai
achega
25d5ddd5a0
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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
     pub fn is_mount_point(&self) -> bool {
         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
     }