1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 20:47:46 +00:00

fixup! Run clippy on the full workspace

This commit is contained in:
Jan Verbeek 2021-08-24 17:28:10 +02:00
parent d06c074829
commit acfd1ebe57
2 changed files with 6 additions and 8 deletions

View file

@ -10,7 +10,7 @@ fn unimplemented_flags_should_error_non_linux() {
let mut succeeded = Vec::new();
// The following flags are only implemented in linux
for flag in vec![
for &flag in &[
"direct",
"directory",
"dsync",
@ -27,13 +27,11 @@ fn unimplemented_flags_should_error_non_linux() {
];
let matches = uu_app().get_matches_from_safe(args).unwrap();
match parse_iflags(&matches) {
Ok(_) => succeeded.push(format!("iflag={}", flag)),
Err(_) => { /* expected behaviour :-) */ }
if parse_iflags(&matches).is_ok() {
succeeded.push(format!("iflag={}", flag));
}
match parse_oflags(&matches) {
Ok(_) => succeeded.push(format!("oflag={}", flag)),
Err(_) => { /* expected behaviour :-) */ }
if parse_oflags(&matches).is_ok() {
succeeded.push(format!("oflag={}", flag));
}
}

View file

@ -104,7 +104,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
settings.strategy = String::from(OPT_LINES);
settings.strategy_param = matches.value_of(OPT_LINES).unwrap().to_owned();
// take any (other) defined strategy
for strategy in vec![OPT_LINE_BYTES, OPT_BYTES].into_iter() {
for &strategy in &[OPT_LINE_BYTES, OPT_BYTES] {
if matches.occurrences_of(strategy) > 0 {
settings.strategy = String::from(strategy);
settings.strategy_param = matches.value_of(strategy).unwrap().to_owned();