Skip to content

Commit

Permalink
Avoid Vec::new()
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Dec 12, 2024
1 parent b199d57 commit b9abcbd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,10 @@ impl Subcommand {
config,
name,
doc.as_deref(),
aliases.get(recipe.name()).unwrap_or(&Vec::new()),
aliases
.get(recipe.name())
.map(Vec::as_slice)
.unwrap_or_default(),
max_signature_width,
&signature_widths,
);
Expand All @@ -683,7 +686,7 @@ impl Subcommand {
config,
submodule.name(),
submodule.doc.as_deref(),
&Vec::new(),
&[],
max_signature_width,
&signature_widths,
);
Expand Down

0 comments on commit b9abcbd

Please sign in to comment.