remove warnings about user settings deeper in the stack
This commit is contained in:
parent
13ea5fded4
commit
a2bbc8d258
|
@ -349,9 +349,17 @@ fn lines_from_file(file: fs::File) -> Vec<String> {
|
||||||
.lines()
|
.lines()
|
||||||
.filter(|line| line.is_ok())
|
.filter(|line| line.is_ok())
|
||||||
.map(|line| line.unwrap())
|
.map(|line| line.unwrap())
|
||||||
|
.filter(|msg| !is_user_setting_warning(msg))
|
||||||
.collect()
|
.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)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
fn nix() -> Nix {
|
fn nix() -> Nix {
|
||||||
|
|
|
@ -43,7 +43,6 @@ impl HydraNixEnv {
|
||||||
.collect::<Result<Vec<String>, _>>()?
|
.collect::<Result<Vec<String>, _>>()?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|msg| msg.trim().len() > 0)
|
.filter(|msg| msg.trim().len() > 0)
|
||||||
.filter(|msg| !is_user_setting_warning(msg))
|
|
||||||
.collect::<Vec<String>>();
|
.collect::<Vec<String>>();
|
||||||
|
|
||||||
if evaluation_errors.len() > 0 {
|
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")
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue