Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/fuzz_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ fn generate_test_arg() -> String {
let random_str = generate_random_string(rng.random_range(1..=10));
let random_str2 = generate_random_string(rng.random_range(1..=10));

arg.push_str(&format!("{random_str} {} {random_str2}", test_arg.arg,));
arg.push_str(&format!("{random_str} {} {random_str2}", test_arg.arg));
} else if test_arg.arg_type == ArgType::STRING {
let random_str = generate_random_string(rng.random_range(1..=10));
arg.push_str(&format!("{} {random_str}", test_arg.arg));
Expand Down
2 changes: 1 addition & 1 deletion src/uu/dircolors/src/dircolors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ fn generate_ls_colors(fmt: &OutputFmt, sep: &str) -> String {
}
let (prefix, suffix) = get_colors_format_strings(fmt);
let ls_colors = parts.join(sep);
format!("{prefix}{}:{ls_colors}:{suffix}", generate_type_output(fmt),)
format!("{prefix}{}:{ls_colors}:{suffix}", generate_type_output(fmt))
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/uu/nproc/src/nproc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,5 @@ fn num_cpus_all() -> usize {
/// In some cases, [`thread::available_parallelism`]() may return an Err
/// In this case, we will return 1 (like GNU)
fn available_parallelism() -> usize {
thread::available_parallelism()
.map(std::num::NonZeroUsize::get)
.unwrap_or(1)
thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get)
}
2 changes: 1 addition & 1 deletion src/uu/pr/src/pr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ fn get_formatted_line_number(opts: &OutputOptions, line_number: usize, index: us
let width = num_opt.width;
let separator = &num_opt.separator;
if line_str.len() >= width {
format!("{:>width$}{separator}", &line_str[line_str.len() - width..],)
format!("{:>width$}{separator}", &line_str[line_str.len() - width..])
} else {
format!("{line_str:>width$}{separator}")
}
Expand Down
2 changes: 1 addition & 1 deletion src/uu/stdbuf/src/libstdbuf/src/libstdbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn set_buffer(stream: *mut FILE, value: &str) {
if res != 0 {
eprintln!("could not set buffering of {} to mode {mode}", unsafe {
fileno(stream)
},);
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/uu/touch/src/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
.ok_or_else(|| {
USimpleError::new(
1,
translate!("touch-error-missing-file-operand", "help_command" => uucore::execution_phrase().to_string(),),
translate!("touch-error-missing-file-operand", "help_command" => uucore::execution_phrase().to_string()),
)
})?
.collect();
Expand Down
8 changes: 4 additions & 4 deletions src/uucore/src/lib/features/systemd_logind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ mod login {

if result < 0 {
return Err(
format!("sd_session_get_uid failed for session '{session_id}': {result}",).into(),
format!("sd_session_get_uid failed for session '{session_id}': {result}").into(),
);
}

Expand Down Expand Up @@ -123,7 +123,7 @@ mod login {

if result < 0 {
return Err(
format!("sd_session_get_tty failed for session '{session_id}': {result}",).into(),
format!("sd_session_get_tty failed for session '{session_id}': {result}").into(),
);
}

Expand Down Expand Up @@ -209,7 +209,7 @@ mod login {

if result < 0 {
return Err(
format!("sd_session_get_type failed for session '{session_id}': {result}",).into(),
format!("sd_session_get_type failed for session '{session_id}': {result}").into(),
);
}

Expand Down Expand Up @@ -237,7 +237,7 @@ mod login {

if result < 0 {
return Err(
format!("sd_session_get_seat failed for session '{session_id}': {result}",).into(),
format!("sd_session_get_seat failed for session '{session_id}': {result}").into(),
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ fn test_date_locale_en_us_vs_c_difference() {
}

#[test]
#[cfg(any(target_os = "linux", target_os = "android", target_vendor = "apple",))]
#[cfg(any(target_os = "linux", target_os = "android", target_vendor = "apple"))]
fn test_date_locale_fr_french() {
// Test French locale (fr_FR.UTF-8) behavior
// French typically uses 24-hour format and may have localized day/month names
Expand Down
4 changes: 2 additions & 2 deletions tests/by-util/test_tail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3773,10 +3773,10 @@ fn test_when_argument_file_is_non_existent_unix_socket_address_then_error() {
format!("tail: cannot open '{socket}' for reading: No such device or address\n");
#[cfg(target_os = "freebsd")]
let expected_stderr =
format!("tail: cannot open '{socket}' for reading: Operation not supported\n",);
format!("tail: cannot open '{socket}' for reading: Operation not supported\n");
#[cfg(target_os = "macos")]
let expected_stderr =
format!("tail: cannot open '{socket}' for reading: Operation not supported on socket\n",);
format!("tail: cannot open '{socket}' for reading: Operation not supported on socket\n");

ts.ucmd()
.arg(socket)
Expand Down
Loading