Skip to content
Open
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
12 changes: 7 additions & 5 deletions src/uu/ls/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use std::{
borrow::Cow,
ffi::{OsStr, OsString},
io::{IsTerminal, stdout},
io::{self, IsTerminal, Write as _, stdout},
num::IntErrorKind,
};

Expand Down Expand Up @@ -574,12 +574,14 @@
} else {
// If set, the QUOTING_STYLE environment variable specifies a default style.
if let Ok(style) = std::env::var("QUOTING_STYLE") {
match match_quoting_style_name(style.as_str(), show_control) {
Some(pair) => return pair,
None => eprintln!(
if let Some(pair) = match_quoting_style_name(style.as_str(), show_control) {
return pair;
} else {

Check failure on line 579 in src/uu/ls/src/config.rs

View workflow job for this annotation

GitHub Actions / Style and Lint (ubuntu-24.04, unix)

ERROR: `cargo clippy`: redundant else block (file:'src/uu/ls/src/config.rs', line:579)

Check failure on line 579 in src/uu/ls/src/config.rs

View workflow job for this annotation

GitHub Actions / Style and Lint (unix)

ERROR: `cargo clippy`: redundant else block (file:'src/uu/ls/src/config.rs', line:579)
let _ = writeln!(
io::stderr(),
"{}",
translate!("ls-invalid-quoting-style", "program" => std::env::args().next().unwrap_or_else(|| "ls".to_string()), "style" => style.clone())
),
);
}
}

Expand Down
Loading