Skip to content

Commit

Permalink
style: Use String::new instead of ""
Browse files Browse the repository at this point in the history
  • Loading branch information
ysthakur committed Nov 18, 2023
1 parent 0b2ebcf commit 529390c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gen/zsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ fn generate_fn(cmd: &CommandInfo, out: &mut Output, fn_name: &str) {
out.indent();
for flag in &cmd.flags {
let desc = if let Some(desc) = &flag.desc {
desc.replace("[", "\\[").replace("]", "\\]")
desc.replace('[', "\\[").replace(']', "\\]")
} else {
"".to_string()
String::new()
};
for form in &flag.forms {
let text = util::quote_bash(format!("{form}[{desc}]"));
Expand Down

0 comments on commit 529390c

Please sign in to comment.