Parcourir la source

ci: Fix windows build

Robert Minsk il y a 2 ans
Parent
commit
81ca000c6a
2 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 4 1
      src/fs/mounts/mod.rs
  2. 2 0
      src/main.rs

+ 4 - 1
src/fs/mounts/mod.rs

@@ -29,11 +29,14 @@ impl std::error::Error for Error {}
 
 impl std::fmt::Display for Error {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        // Allow unreachable_patterns for windows build
+        #[allow(unreachable_patterns)]
         match self {
             #[cfg(target_os = "macos")]
             Error::GetFSStatError(err) => write!(f, "getfsstat failed: {err}"),
             #[cfg(target_os = "linux")]
-            Error::IOError(err) => write!(f, "failed to read /proc/mounts: {err}")
+            Error::IOError(err) => write!(f, "failed to read /proc/mounts: {err}"),
+            _ => write!(f, "Unknown error"),
         }
     }
 }

+ 2 - 0
src/main.rs

@@ -62,6 +62,8 @@ mod theme;
 // to `clap` is complete.
 lazy_static! {
     static ref ALL_MOUNTS: HashMap<PathBuf, mounts::MountedFs> = {
+        // Allow unused_mut for windows
+        #[allow(unused_mut)]
         let mut mount_map: HashMap<PathBuf, mounts::MountedFs> = HashMap::new();
 
         #[cfg(any(target_os = "linux", target_os = "macos"))]