Skip to content

Commit f00a050

Browse files
authored
clippy: fix nightly lints (#11232)
1 parent a6b0276 commit f00a050

9 files changed

Lines changed: 13 additions & 15 deletions

File tree

fuzz/fuzz_targets/fuzz_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fn generate_test_arg() -> String {
143143
let random_str = generate_random_string(rng.random_range(1..=10));
144144
let random_str2 = generate_random_string(rng.random_range(1..=10));
145145

146-
arg.push_str(&format!("{random_str} {} {random_str2}", test_arg.arg,));
146+
arg.push_str(&format!("{random_str} {} {random_str2}", test_arg.arg));
147147
} else if test_arg.arg_type == ArgType::STRING {
148148
let random_str = generate_random_string(rng.random_range(1..=10));
149149
arg.push_str(&format!("{} {random_str}", test_arg.arg));

src/uu/dircolors/src/dircolors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fn generate_ls_colors(fmt: &OutputFmt, sep: &str) -> String {
112112
}
113113
let (prefix, suffix) = get_colors_format_strings(fmt);
114114
let ls_colors = parts.join(sep);
115-
format!("{prefix}{}:{ls_colors}:{suffix}", generate_type_output(fmt),)
115+
format!("{prefix}{}:{ls_colors}:{suffix}", generate_type_output(fmt))
116116
}
117117
}
118118

src/uu/nproc/src/nproc.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,5 @@ fn num_cpus_all() -> usize {
126126
/// In some cases, [`thread::available_parallelism`]() may return an Err
127127
/// In this case, we will return 1 (like GNU)
128128
fn available_parallelism() -> usize {
129-
thread::available_parallelism()
130-
.map(std::num::NonZeroUsize::get)
131-
.unwrap_or(1)
129+
thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get)
132130
}

src/uu/pr/src/pr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ fn get_formatted_line_number(opts: &OutputOptions, line_number: usize, index: us
13301330
let width = num_opt.width;
13311331
let separator = &num_opt.separator;
13321332
if line_str.len() >= width {
1333-
format!("{:>width$}{separator}", &line_str[line_str.len() - width..],)
1333+
format!("{:>width$}{separator}", &line_str[line_str.len() - width..])
13341334
} else {
13351335
format!("{line_str:>width$}{separator}")
13361336
}

src/uu/stdbuf/src/libstdbuf/src/libstdbuf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn set_buffer(stream: *mut FILE, value: &str) {
207207
if res != 0 {
208208
eprintln!("could not set buffering of {} to mode {mode}", unsafe {
209209
fileno(stream)
210-
},);
210+
});
211211
}
212212
}
213213

src/uu/touch/src/touch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
203203
.ok_or_else(|| {
204204
USimpleError::new(
205205
1,
206-
translate!("touch-error-missing-file-operand", "help_command" => uucore::execution_phrase().to_string(),),
206+
translate!("touch-error-missing-file-operand", "help_command" => uucore::execution_phrase().to_string()),
207207
)
208208
})?
209209
.collect();

src/uucore/src/lib/features/systemd_logind.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ mod login {
8989

9090
if result < 0 {
9191
return Err(
92-
format!("sd_session_get_uid failed for session '{session_id}': {result}",).into(),
92+
format!("sd_session_get_uid failed for session '{session_id}': {result}").into(),
9393
);
9494
}
9595

@@ -123,7 +123,7 @@ mod login {
123123

124124
if result < 0 {
125125
return Err(
126-
format!("sd_session_get_tty failed for session '{session_id}': {result}",).into(),
126+
format!("sd_session_get_tty failed for session '{session_id}': {result}").into(),
127127
);
128128
}
129129

@@ -209,7 +209,7 @@ mod login {
209209

210210
if result < 0 {
211211
return Err(
212-
format!("sd_session_get_type failed for session '{session_id}': {result}",).into(),
212+
format!("sd_session_get_type failed for session '{session_id}': {result}").into(),
213213
);
214214
}
215215

@@ -237,7 +237,7 @@ mod login {
237237

238238
if result < 0 {
239239
return Err(
240-
format!("sd_session_get_seat failed for session '{session_id}': {result}",).into(),
240+
format!("sd_session_get_seat failed for session '{session_id}': {result}").into(),
241241
);
242242
}
243243

tests/by-util/test_date.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1620,7 +1620,7 @@ fn test_date_locale_en_us_vs_c_difference() {
16201620
}
16211621

16221622
#[test]
1623-
#[cfg(any(target_os = "linux", target_os = "android", target_vendor = "apple",))]
1623+
#[cfg(any(target_os = "linux", target_os = "android", target_vendor = "apple"))]
16241624
fn test_date_locale_fr_french() {
16251625
// Test French locale (fr_FR.UTF-8) behavior
16261626
// French typically uses 24-hour format and may have localized day/month names

tests/by-util/test_tail.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3773,10 +3773,10 @@ fn test_when_argument_file_is_non_existent_unix_socket_address_then_error() {
37733773
format!("tail: cannot open '{socket}' for reading: No such device or address\n");
37743774
#[cfg(target_os = "freebsd")]
37753775
let expected_stderr =
3776-
format!("tail: cannot open '{socket}' for reading: Operation not supported\n",);
3776+
format!("tail: cannot open '{socket}' for reading: Operation not supported\n");
37773777
#[cfg(target_os = "macos")]
37783778
let expected_stderr =
3779-
format!("tail: cannot open '{socket}' for reading: Operation not supported on socket\n",);
3779+
format!("tail: cannot open '{socket}' for reading: Operation not supported on socket\n");
37803780

37813781
ts.ucmd()
37823782
.arg(socket)

0 commit comments

Comments
 (0)