fix: cfg-gate udev-check helper functions for Linux host build
- count_status: cfg-gated to Redox only (uses CheckStatus) - list_dir_names: cfg-gated to Redox only (uses std::fs) Verified: host cargo check zero warnings, Redox-target make r.redbear-hwutils builds and publishes successfully (x86_64-unknown-redox).
This commit is contained in:
@@ -194,6 +194,7 @@ fn overall_success(report: &Report, config: &Config) -> bool {
|
||||
checks.iter().all(|c| matches!(c, CheckStatus::Pass(_)))
|
||||
}
|
||||
|
||||
#[cfg(target_os = "redox")]
|
||||
fn count_status(count: usize, label: &str) -> CheckStatus {
|
||||
if count > 0 {
|
||||
CheckStatus::Pass(format!("{} {} device(s) found", count, label))
|
||||
@@ -202,6 +203,7 @@ fn count_status(count: usize, label: &str) -> CheckStatus {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "redox")]
|
||||
fn list_dir_names(path: &str) -> Result<Vec<String>, String> {
|
||||
let entries = fs::read_dir(path).map_err(|err| format!("failed to read {path}: {err}"))?;
|
||||
let mut names = entries
|
||||
|
||||
Reference in New Issue
Block a user