From 9227ab1c7c0d5b766dfa2c47ed847fa8654709e2 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 3 May 2023 19:25:44 -0500 Subject: [PATCH] refactor(help): Be consistent in join style --- clap_builder/src/output/help_template.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/clap_builder/src/output/help_template.rs b/clap_builder/src/output/help_template.rs index 86a61169..863e906b 100644 --- a/clap_builder/src/output/help_template.rs +++ b/clap_builder/src/output/help_template.rs @@ -914,11 +914,8 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> { let next_line_help = self.will_subcommands_wrap(cmd.get_subcommands(), longest); - let mut first = true; - for (_, sc_str, sc) in ord_v { - if first { - first = false; - } else { + for (i, (_, sc_str, sc)) in ord_v.into_iter().enumerate() { + if 0 < i { self.writer.push_str("\n"); } self.write_subcommand(sc_str, sc, next_line_help, longest);