diff --git a/ofborg/src/nix.rs b/ofborg/src/nix.rs index caac506..3f438a3 100644 --- a/ofborg/src/nix.rs +++ b/ofborg/src/nix.rs @@ -349,9 +349,17 @@ fn lines_from_file(file: fs::File) -> Vec { .lines() .filter(|line| line.is_ok()) .map(|line| line.unwrap()) + .filter(|msg| !is_user_setting_warning(msg)) .collect() } +fn is_user_setting_warning(line: &str) -> bool { + let line = line.trim(); + line.starts_with("warning: ignoring the user-specified setting '") + && line.ends_with("because it is a restricted setting and you are not a trusted user") +} + + #[cfg(test)] mod tests { fn nix() -> Nix { diff --git a/ofborg/src/nixenv.rs b/ofborg/src/nixenv.rs index dfbab17..fee1b8b 100644 --- a/ofborg/src/nixenv.rs +++ b/ofborg/src/nixenv.rs @@ -43,7 +43,6 @@ impl HydraNixEnv { .collect::, _>>()? .into_iter() .filter(|msg| msg.trim().len() > 0) - .filter(|msg| !is_user_setting_warning(msg)) .collect::>(); if evaluation_errors.len() > 0 { @@ -173,9 +172,3 @@ impl Error { } } } - -fn is_user_setting_warning(line: &str) -> bool { - let line = line.trim(); - line.starts_with("warning: ignoring the user-specified setting '") - && line.ends_with("because it is a restricted setting and you are not a trusted user") -}