Skip to content

Commit

Permalink
fix: Don't panic on non-built arg rendering
Browse files Browse the repository at this point in the history
For num_args, we'll just use the default

Fixes #4479
  • Loading branch information
epage committed Nov 14, 2022
1 parent 95144b7 commit c939de8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/builder/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4183,7 +4183,7 @@ impl Arg {
fn render_arg_val(&self, required: bool) -> String {
let mut rendered = String::new();

let num_vals = self.get_num_args().expect(INTERNAL_ERROR_MSG);
let num_vals = self.get_num_args().unwrap_or_else(|| 1.into());

let mut val_names = if self.val_names.is_empty() {
vec![self.id.as_internal_str().to_owned()]
Expand Down

0 comments on commit c939de8

Please sign in to comment.