diff --git a/src/uu/stdbuf/src/stdbuf.rs b/src/uu/stdbuf/src/stdbuf.rs index 8c65a5c7e..ddbd76133 100644 --- a/src/uu/stdbuf/src/stdbuf.rs +++ b/src/uu/stdbuf/src/stdbuf.rs @@ -144,7 +144,9 @@ fn check_option(matches: &ArgMatches, name: &str) -> Result match value { "L" => { if name == options::INPUT { - Err(ProgramOptionsError("line buffering stdin is meaningless".to_string())) + Err(ProgramOptionsError( + "line buffering stdin is meaningless".to_string(), + )) } else { Ok(BufferType::Line) } diff --git a/src/uu/unexpand/src/unexpand.rs b/src/uu/unexpand/src/unexpand.rs index 3d80bd6e9..a811d3b66 100644 --- a/src/uu/unexpand/src/unexpand.rs +++ b/src/uu/unexpand/src/unexpand.rs @@ -150,7 +150,7 @@ fn next_tabstop(tabstops: &[usize], col: usize) -> Option { } else { // find next larger tab // if there isn't one in the list, tab becomes a single space - tabstops.iter().find(|&&t| t > col).map(|t| t-col) + tabstops.iter().find(|&&t| t > col).map(|t| t - col) } } diff --git a/tests/by-util/test_chmod.rs b/tests/by-util/test_chmod.rs index d60b8a50b..9eda769f1 100644 --- a/tests/by-util/test_chmod.rs +++ b/tests/by-util/test_chmod.rs @@ -357,7 +357,8 @@ fn test_chmod_symlink_non_existing_file() { at.symlink_file(non_existing, test_symlink); // this cannot succeed since the symbolic link dangles - scene.ucmd() + scene + .ucmd() .arg("755") .arg("-v") .arg(test_symlink) @@ -367,7 +368,8 @@ fn test_chmod_symlink_non_existing_file() { .stderr_contains(expected_stderr); // this should be the same than with just '-v' but without stderr - scene.ucmd() + scene + .ucmd() .arg("755") .arg("-v") .arg("-f") @@ -394,7 +396,8 @@ fn test_chmod_symlink_non_existing_file_recursive() { ); // this should succeed - scene.ucmd() + scene + .ucmd() .arg("-R") .arg("755") .arg(test_directory) @@ -408,7 +411,8 @@ fn test_chmod_symlink_non_existing_file_recursive() { ); // '-v': this should succeed without stderr - scene.ucmd() + scene + .ucmd() .arg("-R") .arg("-v") .arg("755") @@ -418,7 +422,8 @@ fn test_chmod_symlink_non_existing_file_recursive() { .no_stderr(); // '-vf': this should be the same than with just '-v' - scene.ucmd() + scene + .ucmd() .arg("-R") .arg("-v") .arg("-f") diff --git a/tests/by-util/test_du.rs b/tests/by-util/test_du.rs index f668edeef..ea6b18937 100644 --- a/tests/by-util/test_du.rs +++ b/tests/by-util/test_du.rs @@ -7,9 +7,7 @@ const SUB_LINK: &str = "subdir/links/sublink.txt"; #[test] fn test_du_basics() { - new_ucmd!() - .succeeds() - .no_stderr(); + new_ucmd!().succeeds().no_stderr(); } #[cfg(target_vendor = "apple")] fn _du_basics(s: String) { @@ -178,7 +176,14 @@ fn test_du_h_flag_empty_file() { fn test_du_time() { let ts = TestScenario::new("du"); - let touch = ts.ccmd("touch").arg("-a").arg("-m").arg("-t").arg("201505150000").arg("date_test").run(); + let touch = ts + .ccmd("touch") + .arg("-a") + .arg("-m") + .arg("-t") + .arg("201505150000") + .arg("date_test") + .run(); assert!(touch.success); let result = ts.ucmd().arg("--time").arg("date_test").run(); diff --git a/tests/by-util/test_echo.rs b/tests/by-util/test_echo.rs index 99c8f3a1e..5d1b68e6c 100644 --- a/tests/by-util/test_echo.rs +++ b/tests/by-util/test_echo.rs @@ -2,10 +2,7 @@ use crate::common::util::*; #[test] fn test_default() { - new_ucmd!() - .arg("hi") - .succeeds() - .stdout_only("hi\n"); + new_ucmd!().arg("hi").succeeds().stdout_only("hi\n"); } #[test] diff --git a/tests/by-util/test_env.rs b/tests/by-util/test_env.rs index 19ecd7afb..39baf473b 100644 --- a/tests/by-util/test_env.rs +++ b/tests/by-util/test_env.rs @@ -26,17 +26,18 @@ fn test_env_version() { #[test] fn test_echo() { - let result = new_ucmd!() - .arg("echo") - .arg("FOO-bar") - .succeeds(); + let result = new_ucmd!().arg("echo").arg("FOO-bar").succeeds(); assert_eq!(result.stdout_str().trim(), "FOO-bar"); } #[test] fn test_file_option() { - let out = new_ucmd!().arg("-f").arg("vars.conf.txt").run().stdout_move_str(); + let out = new_ucmd!() + .arg("-f") + .arg("vars.conf.txt") + .run() + .stdout_move_str(); assert_eq!( out.lines() @@ -89,7 +90,8 @@ fn test_multiple_name_value_pairs() { let out = new_ucmd!().arg("FOO=bar").arg("ABC=xyz").run(); assert_eq!( - out.stdout_str().lines() + out.stdout_str() + .lines() .filter(|&line| line == "FOO=bar" || line == "ABC=xyz") .count(), 2 diff --git a/tests/by-util/test_fold.rs b/tests/by-util/test_fold.rs index ffcd65737..5224a50dc 100644 --- a/tests/by-util/test_fold.rs +++ b/tests/by-util/test_fold.rs @@ -542,4 +542,4 @@ fn test_obsolete_syntax() { .arg("space_separated_words.txt") .succeeds() .stdout_is("test1\n \ntest2\n \ntest3\n \ntest4\n \ntest5\n \ntest6\n "); -} \ No newline at end of file +} diff --git a/tests/by-util/test_hostname.rs b/tests/by-util/test_hostname.rs index 9fa63241f..c9dc99040 100644 --- a/tests/by-util/test_hostname.rs +++ b/tests/by-util/test_hostname.rs @@ -25,6 +25,8 @@ fn test_hostname_full() { let ls_short_res = new_ucmd!().arg("-s").succeeds(); assert!(!ls_short_res.stdout_str().trim().is_empty()); - new_ucmd!().arg("-f").succeeds() + new_ucmd!() + .arg("-f") + .succeeds() .stdout_contains(ls_short_res.stdout_str().trim()); } diff --git a/tests/by-util/test_id.rs b/tests/by-util/test_id.rs index 7e2791467..719cfd876 100644 --- a/tests/by-util/test_id.rs +++ b/tests/by-util/test_id.rs @@ -46,7 +46,8 @@ fn test_id_from_name() { let result = new_ucmd!().arg(&username).succeeds(); let uid = result.stdout_str().trim(); - new_ucmd!().succeeds() + new_ucmd!() + .succeeds() // Verify that the id found by --user/-u exists in the list .stdout_contains(uid) // Verify that the username found by whoami exists in the list @@ -65,10 +66,7 @@ fn test_id_name_from_id() { return; } - let username_id = result - .success() - .stdout_str() - .trim(); + let username_id = result.success().stdout_str().trim(); let scene = TestScenario::new("whoami"); let result = scene.cmd("whoami").succeeds(); diff --git a/tests/by-util/test_sort.rs b/tests/by-util/test_sort.rs index 0f8020688..c3b8870b9 100644 --- a/tests/by-util/test_sort.rs +++ b/tests/by-util/test_sort.rs @@ -16,10 +16,10 @@ fn test_months_whitespace() { #[test] fn test_version_empty_lines() { new_ucmd!() - .arg("-V") - .arg("version-empty-lines.txt") - .succeeds() - .stdout_is("\n\n\n\n\n\n\n1.2.3-alpha\n1.2.3-alpha2\n\t\t\t1.12.4\n11.2.3\n"); + .arg("-V") + .arg("version-empty-lines.txt") + .succeeds() + .stdout_is("\n\n\n\n\n\n\n1.2.3-alpha\n1.2.3-alpha2\n\t\t\t1.12.4\n11.2.3\n"); } #[test]