mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-14 19:16:17 +00:00
correct clippy issues, RustFmt
This commit is contained in:
parent
2106ddd088
commit
5646c81332
1 changed files with 7 additions and 8 deletions
|
@ -347,20 +347,19 @@ fn cat_files(files: Vec<String>, options: &OutputOptions) -> UResult<()> {
|
||||||
|
|
||||||
for path in &files {
|
for path in &files {
|
||||||
if let Err(err) = cat_path(path, options, &mut state) {
|
if let Err(err) = cat_path(path, options, &mut state) {
|
||||||
error_messages.push(
|
error_messages.push(format!("{}: {}", path, err));
|
||||||
format!("{}: {}", path, err));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if error_messages.len() == 0 {
|
if error_messages.is_empty() {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
// each next line is expected to display "cat: …"
|
// each next line is expected to display "cat: …"
|
||||||
let line_joiner = format!("\n{}: ",
|
let line_joiner = format!("\n{}: ", executable!());
|
||||||
executable!()).to_owned();
|
|
||||||
|
|
||||||
Err(uucore::error::USimpleError::new(
|
Err(uucore::error::USimpleError::new(
|
||||||
error_messages.len() as i32,
|
error_messages.len() as i32,
|
||||||
error_messages.join(&line_joiner).into()))
|
error_messages.join(&line_joiner),
|
||||||
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue