Skip to content

Commit

Permalink
use a single push_str
Browse files Browse the repository at this point in the history
Co-authored-by: Terts Diepraam <[email protected]>
  • Loading branch information
sylvestre and tertsdiepraam authored Dec 6, 2023
1 parent b0fdb1e commit 97ec99c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/uu/dircolors/src/dircolors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,17 @@ fn escape(s: &str) -> String {
pub fn generate_dircolors_config() -> String {

Check failure on line 481 in src/uu/dircolors/src/dircolors.rs

View workflow job for this annotation

GitHub Actions / Style/format (ubuntu-latest, feat_os_unix)

ERROR: `cargo fmt`: style violation (file:'src/uu/dircolors/src/dircolors.rs', line:481; use `cargo fmt -- "src/uu/dircolors/src/dircolors.rs"`)
let mut config = String::new();

config.push_str("# Configuration file for dircolors, a utility to help you set the\n");
config.push_str("# LS_COLORS environment variable used by GNU ls with the --color option.\n");
config.push_str("# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the\n");
config.push_str("# slackware version of dircolors) are recognized but ignored.\n");
config.push_str("# Global config options can be specified before TERM or COLORTERM entries\n");
config.push_str("# Below are TERM or COLORTERM entries, which can be glob patterns, which\n");
config
.push_str("# restrict following config to systems with matching environment variables.\n");
config.push_str(
"\
# Configuration file for dircolors, a utility to help you set the\n\
# LS_COLORS environment variable used by GNU ls with the --color option.\n\
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the\n\
# slackware version of dircolors) are recognized but ignored.\n\
# Global config options can be specified before TERM or COLORTERM entries\n\
# Below are TERM or COLORTERM entries, which can be glob patterns, which\n\
# restrict following config to systems with matching environment variables.\n\
",
);
config.push_str("COLORTERM ?*\n");
for term in TERMS {
config.push_str(&format!("TERM {}\n", term));
Expand Down

0 comments on commit 97ec99c

Please sign in to comment.