Fix Windows build warnings

- Add cfg guard for std::process::Command (only used on Linux/macOS)
- Add #[allow(dead_code)] for unmount_device and sync_device
This commit is contained in:
SuperKali
2025-12-12 08:31:01 +01:00
parent c9c8e77ad4
commit ad985d3d16

View File

@@ -18,6 +18,7 @@ use sha2::{Digest, Sha256};
use std::fs::File;
use std::io::Read;
use std::path::PathBuf;
#[cfg(any(target_os = "linux", target_os = "macos"))]
use std::process::Command;
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
use tokio::sync::Mutex;
@@ -74,6 +75,7 @@ pub fn request_authorization(_device_path: &str) -> Result<bool, String> {
}
/// Unmount a device before flashing (platform-specific)
#[allow(dead_code)]
pub(crate) fn unmount_device(device_path: &str) -> Result<(), String> {
#[cfg(target_os = "macos")]
{
@@ -106,6 +108,7 @@ pub(crate) fn unmount_device(device_path: &str) -> Result<(), String> {
}
/// Sync device to ensure all data is written to disk
#[allow(dead_code)]
pub(crate) fn sync_device(_device_path: &str) {
#[cfg(any(target_os = "linux", target_os = "macos"))]
{