fix: macos build

This commit is contained in:
xkeyC 2025-12-05 11:29:35 +08:00
parent 62b8718dbd
commit fe141d98c2

View File

@ -351,7 +351,7 @@ pub fn resolve_shortcut(lnk_path: &str) -> anyhow::Result<String> {
} }
#[cfg(not(target_os = "windows"))] #[cfg(not(target_os = "windows"))]
pub fn resolve_shortcut(lnk_path: &str) -> anyhow::Result<String> { pub fn resolve_shortcut(_: &str) -> anyhow::Result<String> {
Ok(String::new()) Ok(String::new())
} }
@ -756,8 +756,9 @@ pub fn start_process(program: &str, args: Vec<String>) -> anyhow::Result<()> {
} }
// ============== NVME Patch Functions ============== // ============== NVME Patch Functions ==============
#[cfg(target_os = "windows")]
const NVME_REGISTRY_PATH: &str = r"SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device"; const NVME_REGISTRY_PATH: &str = r"SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device";
#[cfg(target_os = "windows")]
const NVME_VALUE_NAME: &str = "ForcedPhysicalSectorSizeInBytes"; const NVME_VALUE_NAME: &str = "ForcedPhysicalSectorSizeInBytes";
/// Check if NVME patch is applied /// Check if NVME patch is applied
@ -916,3 +917,8 @@ pub fn remove_nvme_patch() -> anyhow::Result<()> {
Ok(()) Ok(())
} }
} }
#[cfg(not(target_os = "windows"))]
pub fn remove_nvme_patch() -> anyhow::Result<()> {
Err(anyhow::anyhow!("NVME patch is only supported on Windows"))
}