diff --git a/src/join/join.rs b/src/join/join.rs index a4f5c126e..0149476e3 100755 --- a/src/join/join.rs +++ b/src/join/join.rs @@ -294,7 +294,7 @@ impl<'a> State<'a> { } } - return None; + None } /// Print lines in the buffers as headers. diff --git a/src/ls/ls.rs b/src/ls/ls.rs index 05f89d8c0..cb9d2bfe1 100644 --- a/src/ls/ls.rs +++ b/src/ls/ls.rs @@ -285,7 +285,7 @@ fn should_display(entry: &DirEntry, options: &getopts::Matches) -> bool { if options.opt_present("B") && name.ends_with('~') { return false; } - return true; + true } fn enter_directory(dir: &PathBuf, options: &getopts::Matches) { diff --git a/src/mv/mv.rs b/src/mv/mv.rs index 62a506f56..bcfc963a7 100644 --- a/src/mv/mv.rs +++ b/src/mv/mv.rs @@ -432,6 +432,6 @@ fn is_empty_dir(path: &PathBuf) -> bool { Ok(contents) => { return contents.peekable().peek().is_none(); }, - Err(_e) => { return false; } + Err(_e) => { false } } } diff --git a/src/od/parse_formats.rs b/src/od/parse_formats.rs index d6318d274..36ce3604e 100644 --- a/src/od/parse_formats.rs +++ b/src/od/parse_formats.rs @@ -254,7 +254,7 @@ fn is_format_size_decimal( match ch { Some(d) if d.is_digit(10) => { decimal_size.push(d); - return true; + true } _ => false, } @@ -264,7 +264,7 @@ fn is_format_dump_char(ch: Option, show_ascii_dump: &mut bool) -> bool { match ch { Some('z') => { *show_ascii_dump = true; - return true; + true } _ => false, } diff --git a/src/printf/printf.rs b/src/printf/printf.rs index 1842f8831..ecca28128 100644 --- a/src/printf/printf.rs +++ b/src/printf/printf.rs @@ -292,5 +292,5 @@ pub fn uumain(args: Vec) -> i32 { let printf_args = &args[2..]; memo::Memo::run_all(formatstr, printf_args); } - return 0; + 0 } diff --git a/src/printf/tokenize/num_format/num_format.rs b/src/printf/tokenize/num_format/num_format.rs index 6a0552d84..cc83a7c17 100644 --- a/src/printf/tokenize/num_format/num_format.rs +++ b/src/printf/tokenize/num_format/num_format.rs @@ -46,7 +46,7 @@ fn get_provided(str_in_opt: Option<&String>) -> Option { if let Some(qchar) = byte_it.next() { match qchar { C_S_QUOTE | C_D_QUOTE => { - return Some(match byte_it.next() { + Some(match byte_it.next() { Some(second_byte) => { let mut ignored: Vec = Vec::new(); for cont in byte_it { @@ -63,11 +63,11 @@ fn get_provided(str_in_opt: Option<&String>) -> Option { warn_expected_numeric(&so_far); 0 as u8 } - }); + }) } // first byte is not quote _ => { - return None; + None } // no first byte } } else { diff --git a/src/sort/sort.rs b/src/sort/sort.rs index b7bebcbb0..db12e5779 100644 --- a/src/sort/sort.rs +++ b/src/sort/sort.rs @@ -337,14 +337,14 @@ fn exec_check_file(lines: Lines>>, settings: &Settings) // line, no matter what our merging function does. if let Some(_last_line_or_next_error) = errors.next() { println!("sort: disorder in line {}", first_error_index); - return 1; + 1 } else { // first "error" was actually the last line. - return 0; + 0 } } else { // unwrapped_lines was empty. Empty files are defined to be sorted. - return 0; + 0 } } @@ -373,7 +373,7 @@ fn compare_by(a: &str, b: &str, settings: &Settings) -> Ordering { } } } - return Ordering::Equal; + Ordering::Equal } /// Parse the beginning string into an f64, returning -inf instead of NaN on errors. diff --git a/src/stdbuf/stdbuf.rs b/src/stdbuf/stdbuf.rs index 6920a1ae9..9c27a1a13 100644 --- a/src/stdbuf/stdbuf.rs +++ b/src/stdbuf/stdbuf.rs @@ -279,9 +279,9 @@ pub fn uumain(args: Vec) -> i32 { }; match process.wait() { Ok(status) => match status.code() { - Some(i) => return i, + Some(i) => i, None => crash!(1, "process killed by signal {}", status.signal().unwrap()), }, Err(e) => crash!(1, "{}", e), - }; + } }