Skip to content

Commit 074a8fe

Browse files
Eric GumbaEric Gumba
authored andcommitted
fix formatting issues
1 parent 6ae9234 commit 074a8fe

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

clap_builder/src/output/help_template.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use crate::output::wrap;
1919
use crate::output::Usage;
2020
use crate::output::TAB;
2121
use crate::output::TAB_WIDTH;
22-
use crate::util::FlatSet;
2322
use crate::util::sort::{option_sort_key, subcmd_sort_key};
23+
use crate::util::FlatSet;
2424

2525
/// `clap` auto-generated help writer
2626
pub(crate) struct AutoHelp<'cmd, 'writer> {

clap_builder/src/util/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
mod any_value;
44
pub(crate) mod flat_map;
55
pub(crate) mod flat_set;
6-
pub(crate) mod sort;
76
mod graph;
87
mod id;
8+
pub(crate) mod sort;
99
mod str_to_bool;
1010

1111
pub use self::id::Id;

clap_builder/src/util/sort.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use crate::{builder::Arg, Command};
22

33
/// Provides consistent sorting for options in help/man output
4-
pub fn option_sort_key(arg: &Arg) -> (usize, String) {
4+
#[allow(dead_code)]
5+
pub(crate) fn option_sort_key(arg: &Arg) -> (usize, String) {
56
let key = if let Some(x) = arg.get_short() {
67
let mut s = x.to_ascii_lowercase().to_string();
78
s.push(if x.is_ascii_lowercase() { '0' } else { '1' });
@@ -17,6 +18,7 @@ pub fn option_sort_key(arg: &Arg) -> (usize, String) {
1718
}
1819

1920
/// Provides consistent sorting for subcommands
20-
pub fn subcmd_sort_key(subcmd: &Command) -> (usize, &str) {
21+
#[allow(dead_code)]
22+
pub(crate) fn subcmd_sort_key(subcmd: &Command) -> (usize, &str) {
2123
(subcmd.get_display_order(), subcmd.get_name())
22-
}
24+
}

clap_mangen/src/render.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use clap::{Arg, ArgAction, option_sort_key, subcmd_sort_key};
1+
use clap::{option_sort_key, subcmd_sort_key, Arg, ArgAction};
22
use roff::{bold, italic, roman, Inline, Roff};
33

44
pub(crate) fn subcommand_heading(cmd: &clap::Command) -> &str {
@@ -206,10 +206,8 @@ fn possible_options(roff: &mut Roff, arg: &Arg, arg_help_written: bool) {
206206
}
207207

208208
pub(crate) fn subcommands(roff: &mut Roff, cmd: &clap::Command, section: &str) {
209-
let mut sorted_subcommands: Vec<_> = cmd
210-
.get_subcommands()
211-
.filter(|s| !s.is_hide_set())
212-
.collect();
209+
let mut sorted_subcommands: Vec<_> =
210+
cmd.get_subcommands().filter(|s| !s.is_hide_set()).collect();
213211
sorted_subcommands.sort_by_key(|sub| subcmd_sort_key(sub));
214212
for sub in sorted_subcommands {
215213
roff.control("TP", []);

0 commit comments

Comments
 (0)