Skip to content

Commit 10531b9

Browse files
committed
fmt
1 parent 4a165a9 commit 10531b9

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/uu/ls/src/ls.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,7 @@ fn parse_time_style(options: &clap::ArgMatches) -> Result<(String, Option<String
299299
"full-iso" => ok((format::FULL_ISO, None)),
300300
"long-iso" => ok((format::LONG_ISO, None)),
301301
// ISO older format needs extra padding.
302-
"iso" => Ok((
303-
"%m-%d %H:%M".to_owned(),
304-
Some(format::ISO.to_owned() + " "),
305-
)),
302+
"iso" => Ok(("%m-%d %H:%M".to_owned(), Some(format::ISO.to_owned() + " "))),
306303
"locale" => ok(LOCALE_FORMAT),
307304
_ => match field.chars().next().unwrap() {
308305
'+' => {

src/uu/numfmt/benches/numfmt_bench.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ fn numfmt_round_modes(bencher: Bencher, (round_mode, count): (&str, usize)) {
115115
bencher
116116
.with_inputs(|| {
117117
let numbers: Vec<String> = (1..=count).map(|n| n.to_string()).collect();
118-
let mut args: Vec<String> =
119-
vec!["--to=si".to_owned(), format!("--round={round_mode}")];
118+
let mut args: Vec<String> = vec!["--to=si".to_owned(), format!("--round={round_mode}")];
120119
args.extend(numbers);
121120
args
122121
})

src/uu/pr/src/pr.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ fn get_date_format(matches: &ArgMatches) -> String {
443443
format::LONG_ISO
444444
}
445445
}
446-
}.to_owned()
446+
}
447+
.to_owned()
447448
}
448449

449450
#[allow(clippy::cognitive_complexity)]
@@ -483,7 +484,8 @@ fn build_options(
483484
paths[0]
484485
},
485486
|s| s.as_str(),
486-
).to_owned();
487+
)
488+
.to_owned();
487489

488490
let default_first_number = NumberingMode::default().first_number;
489491
let first_number =

src/uu/rm/benches/rm_bench.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ fn rm_single_file(bencher: Bencher) {
2121
.path()
2222
.join(format!("f{i}"))
2323
.to_str()
24-
.unwrap().to_owned()
24+
.unwrap()
25+
.to_owned()
2526
})
2627
.collect();
2728
(temp_dir, paths)
@@ -47,7 +48,8 @@ fn rm_multiple_files(bencher: Bencher) {
4748
.path()
4849
.join(format!("f{i}"))
4950
.to_str()
50-
.unwrap().to_owned()
51+
.unwrap()
52+
.to_owned()
5153
})
5254
.collect();
5355
(temp_dir, paths)
@@ -90,7 +92,8 @@ fn rm_force_files(bencher: Bencher) {
9092
.path()
9193
.join(format!("f{i}"))
9294
.to_str()
93-
.unwrap().to_owned()
95+
.unwrap()
96+
.to_owned()
9497
})
9598
.collect();
9699
(temp_dir, paths)

src/uucore/src/lib/features/parser/num_parser.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,10 +1123,7 @@ mod tests {
11231123
);
11241124
assert_eq!(
11251125
f64::extended_parse("0b100.1"),
1126-
Err(ExtendedParserError::PartialMatch(
1127-
0f64,
1128-
"b100.1".to_owned()
1129-
))
1126+
Err(ExtendedParserError::PartialMatch(0f64, "b100.1".to_owned()))
11301127
);
11311128

11321129
assert_eq!(

src/uucore/src/lib/mods/locale.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ fn parse_fluent_resource(content: &str) -> Result<FluentResource, LocalizationEr
227227
.slice
228228
.clone()
229229
.and_then(|range| content.get(range))
230-
.unwrap_or("").to_owned();
230+
.unwrap_or("")
231+
.to_owned();
231232
LocalizationError::ParseResource {
232233
error: first_err,
233234
snippet,
@@ -361,7 +362,8 @@ fn detect_system_locale() -> Result<LanguageIdentifier, LocalizationError> {
361362
.unwrap_or_else(|_| DEFAULT_LOCALE.to_owned())
362363
.split('.')
363364
.next()
364-
.unwrap_or(DEFAULT_LOCALE).to_owned();
365+
.unwrap_or(DEFAULT_LOCALE)
366+
.to_owned();
365367
LanguageIdentifier::from_str(&locale_str).map_err(|_| {
366368
LocalizationError::ParseLocale(format!("Failed to parse locale: {locale_str}"))
367369
})

0 commit comments

Comments
 (0)