diff --git a/src/core.rs b/src/core.rs index 3795b86..21a838b 100644 --- a/src/core.rs +++ b/src/core.rs @@ -224,7 +224,7 @@ impl Pacdef { fn remove_groups(&self, arg_match: &ArgMatches) -> Result<()> { let paths = get_assumed_group_file_names(arg_match)?; - for file in paths.iter() { + for file in &paths { ensure!(file.exists(), "did not find the group under {file:?}"); } diff --git a/src/env.rs b/src/env.rs index 16030b4..8b73725 100644 --- a/src/env.rs +++ b/src/env.rs @@ -7,7 +7,7 @@ pub(crate) fn get_editor() -> Result { } fn check_vars_in_order(vars: &[&str]) -> Option { - vars.iter().flat_map(|v| var(v).ok()).next() + vars.iter().find_map(|v| var(v).ok()) } pub(crate) fn get_single_var(variable: &str) -> Option {