Skip to content

Commit

Permalink
A very minor refactor
Browse files Browse the repository at this point in the history
It snuck into a previous version of this PR; I can take it out, but it
seems like a mild improvement.
  • Loading branch information
ilyagr committed Jun 14, 2024
1 parent 126d512 commit b0da8c5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,6 @@ fn build_command_markdown(
}

fn write_arg_markdown(buffer: &mut String, arg: &clap::Arg) -> fmt::Result {
// Markdown list item
write!(buffer, "* ")?;

let value_name: String = match arg.get_value_names() {
// TODO: What if multiple names are provided?
Some([name, ..]) => name.as_str().to_owned(),
Expand All @@ -389,6 +386,8 @@ fn write_arg_markdown(buffer: &mut String, arg: &clap::Arg) -> fmt::Result {
None => arg.get_id().to_string().to_ascii_uppercase(),
};

// Markdown list item
write!(buffer, "* ")?;
match (arg.get_short(), arg.get_long()) {
(Some(short), Some(long)) => {
if arg.get_action().takes_values() {
Expand Down

0 comments on commit b0da8c5

Please sign in to comment.