Better keychain function descriptions

This commit is contained in:
Gregory Schier
2025-11-19 09:15:50 -08:00
parent 6863decd8e
commit 1fbf9e50c4
4 changed files with 74 additions and 20 deletions

View File

@@ -1,12 +1,30 @@
pub fn get_os() -> &'static str {
use crate::platform::OperatingSystem::{Linux, MacOS, Unknown, Windows};
pub enum OperatingSystem {
Windows,
MacOS,
Linux,
Unknown,
}
pub fn get_os() -> OperatingSystem {
if cfg!(target_os = "windows") {
"windows"
Windows
} else if cfg!(target_os = "macos") {
"macos"
MacOS
} else if cfg!(target_os = "linux") {
"linux"
Linux
} else {
"unknown"
Unknown
}
}
pub fn get_os_str() -> &'static str {
match get_os() {
Windows => "windows",
MacOS => "macos",
Linux => "linux",
Unknown => "unknown",
}
}
@@ -33,4 +51,5 @@ pub fn get_ua_arch() -> &'static str {
"ARM64"
} else {
"Unknown"
}}
}
}