Fix macOS build

This commit is contained in:
DecDuck
2025-10-16 15:32:28 +11:00
parent 87bbe1da49
commit 83d2301056
4 changed files with 11 additions and 11 deletions

View File

@ -4,20 +4,20 @@ use serde::{Deserialize, Serialize};
pub enum Platform {
Windows,
Linux,
MacOs,
macOS,
}
impl Platform {
#[cfg(target_os = "windows")]
pub const HOST: Platform = Self::Windows;
#[cfg(target_os = "macos")]
pub const HOST: Platform = Self::MacOs;
pub const HOST: Platform = Self::macOS;
#[cfg(target_os = "linux")]
pub const HOST: Platform = Self::Linux;
pub fn is_case_sensitive(&self) -> bool {
match self {
Self::Windows | Self::MacOs => false,
Self::Windows | Self::macOS => false,
Self::Linux => true,
}
}
@ -28,7 +28,7 @@ impl From<&str> for Platform {
match value.to_lowercase().trim() {
"windows" => Self::Windows,
"linux" => Self::Linux,
"mac" | "macos" => Self::MacOs,
"mac" | "macos" => Self::macOS,
_ => unimplemented!(),
}
}
@ -39,7 +39,7 @@ impl From<whoami::Platform> for Platform {
match value {
whoami::Platform::Windows => Platform::Windows,
whoami::Platform::Linux => Platform::Linux,
whoami::Platform::MacOS => Platform::MacOs,
whoami::Platform::MacOS => Platform::macOS,
platform => unimplemented!("Playform {} is not supported", platform),
}
}