mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
chore: remove unneeded parens
Keeps code a bit more readable
This commit is contained in:
parent
6ea1f5247f
commit
170831ed2b
12 changed files with 42 additions and 46 deletions
|
@ -5787,11 +5787,7 @@ fn test_dir_perm_race_with_preserve_mode_and_ownership() {
|
|||
} else {
|
||||
libc::S_IRWXG | libc::S_IRWXO
|
||||
} as u32;
|
||||
assert_eq!(
|
||||
(mode & mask),
|
||||
0,
|
||||
"unwanted permissions are present - {attr}"
|
||||
);
|
||||
assert_eq!(mode & mask, 0, "unwanted permissions are present - {attr}");
|
||||
at.write(FIFO, "done");
|
||||
child.wait().unwrap().succeeded();
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ fn test_parallel() {
|
|||
let n_integers = 100_000;
|
||||
let mut input_string = String::new();
|
||||
for i in 0..=n_integers {
|
||||
input_string.push_str(&(format!("{i} "))[..]);
|
||||
input_string.push_str(&format!("{i} "));
|
||||
}
|
||||
|
||||
let tmp_dir = TempDir::new().unwrap();
|
||||
|
@ -100,7 +100,7 @@ fn test_first_1000_integers() {
|
|||
let n_integers = 1000;
|
||||
let mut input_string = String::new();
|
||||
for i in 0..=n_integers {
|
||||
input_string.push_str(&(format!("{i} "))[..]);
|
||||
input_string.push_str(&format!("{i} "));
|
||||
}
|
||||
|
||||
println!("STDIN='{input_string}'");
|
||||
|
@ -124,7 +124,7 @@ fn test_first_1000_integers_with_exponents() {
|
|||
let n_integers = 1000;
|
||||
let mut input_string = String::new();
|
||||
for i in 0..=n_integers {
|
||||
input_string.push_str(&(format!("{i} "))[..]);
|
||||
input_string.push_str(&format!("{i} "));
|
||||
}
|
||||
|
||||
println!("STDIN='{input_string}'");
|
||||
|
@ -197,11 +197,11 @@ fn test_random() {
|
|||
let mut output_string = String::new();
|
||||
for _ in 0..NUM_TESTS {
|
||||
let (product, factors) = rand_gt(1 << 63);
|
||||
input_string.push_str(&(format!("{product} "))[..]);
|
||||
input_string.push_str(&format!("{product} "));
|
||||
|
||||
output_string.push_str(&(format!("{product}:"))[..]);
|
||||
output_string.push_str(&format!("{product}:"));
|
||||
for factor in factors {
|
||||
output_string.push_str(&(format!(" {factor}"))[..]);
|
||||
output_string.push_str(&format!(" {factor}"));
|
||||
}
|
||||
output_string.push('\n');
|
||||
}
|
||||
|
@ -281,11 +281,11 @@ fn test_random_big() {
|
|||
let mut output_string = String::new();
|
||||
for _ in 0..NUM_TESTS {
|
||||
let (product, factors) = rand_64();
|
||||
input_string.push_str(&(format!("{product} "))[..]);
|
||||
input_string.push_str(&format!("{product} "));
|
||||
|
||||
output_string.push_str(&(format!("{product}:"))[..]);
|
||||
output_string.push_str(&format!("{product}:"));
|
||||
for factor in factors {
|
||||
output_string.push_str(&(format!(" {factor}"))[..]);
|
||||
output_string.push_str(&format!(" {factor}"));
|
||||
}
|
||||
output_string.push('\n');
|
||||
}
|
||||
|
@ -298,8 +298,8 @@ fn test_big_primes() {
|
|||
let mut input_string = String::new();
|
||||
let mut output_string = String::new();
|
||||
for prime in PRIMES64 {
|
||||
input_string.push_str(&(format!("{prime} "))[..]);
|
||||
output_string.push_str(&(format!("{prime}: {prime}\n"))[..]);
|
||||
input_string.push_str(&format!("{prime} "));
|
||||
output_string.push_str(&format!("{prime}: {prime}\n"));
|
||||
}
|
||||
|
||||
run(input_string.as_bytes(), output_string.as_bytes());
|
||||
|
@ -325,8 +325,8 @@ fn test_primes_with_exponents() {
|
|||
let mut output_string = String::new();
|
||||
for primes in PRIMES_BY_BITS {
|
||||
for &prime in *primes {
|
||||
input_string.push_str(&(format!("{prime} "))[..]);
|
||||
output_string.push_str(&(format!("{prime}: {prime}\n"))[..]);
|
||||
input_string.push_str(&format!("{prime} "));
|
||||
output_string.push_str(&format!("{prime}: {prime}\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1733,7 +1733,9 @@ fn test_ls_group_directories_first() {
|
|||
.succeeds();
|
||||
assert_eq!(
|
||||
result.stdout_str().split('\n').collect::<Vec<_>>(),
|
||||
(dirnames.into_iter().rev())
|
||||
dirnames
|
||||
.into_iter()
|
||||
.rev()
|
||||
.chain(dots.into_iter().rev())
|
||||
.chain(filenames.into_iter().rev())
|
||||
.chain([""].into_iter())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue