diff --git a/src/uu/env/src/native_int_str.rs b/src/uu/env/src/native_int_str.rs index 856948fc137..7e63a663e4e 100644 --- a/src/uu/env/src/native_int_str.rs +++ b/src/uu/env/src/native_int_str.rs @@ -116,7 +116,7 @@ impl<'a> Convert<&'a Vec<&'a str>, Vec>> for NCvt { impl<'a> Convert, Vec>> for NCvt { fn convert(f: Vec<&'a str>) -> Vec> { - f.iter().map(|x| Self::convert(*x)).collect() + f.into_iter().map(Self::convert).collect() } } diff --git a/src/uu/ptx/src/ptx.rs b/src/uu/ptx/src/ptx.rs index 2bae6511562..7749ecc998a 100644 --- a/src/uu/ptx/src/ptx.rs +++ b/src/uu/ptx/src/ptx.rs @@ -133,16 +133,14 @@ impl WordFilter { let break_set: Option> = if matches.contains_id(options::BREAK_FILE) && !matches.contains_id(options::WORD_REGEXP) { - let chars = + let mut chars = read_char_filter_file(matches, options::BREAK_FILE).map_err_context(String::new)?; - let mut hs: HashSet = if config.gnu_ext { - HashSet::new() // really only chars found in file - } else { + if !config.gnu_ext { // GNU off means at least these are considered - [' ', '\t', '\n'].iter().copied().collect() - }; - hs.extend(chars); - Some(hs) + chars.extend([' ', '\t', '\n']); + } + // else only chars found in file + Some(chars) } else { // if -W takes precedence or default None