Skip to content

Commit 0d480df

Browse files
committed
refactor(cli): use format alignment
1 parent 3d4407d commit 0d480df

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/bin/cargo/cli.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ pub fn main(config: &mut LazyConfig) -> CliResult {
7070
.iter()
7171
.map(|(option_name, option_help_message)| {
7272
let option_name_kebab_case = option_name.replace("_", "-");
73-
let padding = " ".repeat(longest_option - option_name.len()); // safe to subtract
7473
format!(
75-
" -Z {}{} -- {}",
76-
option_name_kebab_case, padding, option_help_message
74+
" -Z {:<longest_option$} -- {}",
75+
option_name_kebab_case, option_help_message
7776
)
7877
})
7978
.collect();

0 commit comments

Comments
 (0)