Skip to content

Commit bf60d05

Browse files
committed
refactor: reduce closure
1 parent c2bb61e commit bf60d05

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/man_page.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn render_name_section(out: &mut String, command: &Command) {
3131
let name = command.get_name();
3232
let about = command
3333
.get_about()
34-
.map(|text| text.to_string())
34+
.map(ToString::to_string)
3535
.unwrap_or_default();
3636
writeln!(out, ".SH NAME").unwrap();
3737
writeln!(out, "{name} \\- {}", roff_escape(&about)).unwrap();
@@ -99,7 +99,7 @@ fn render_description_section(out: &mut String, command: &Command) {
9999
let text = command
100100
.get_long_about()
101101
.or_else(|| command.get_about())
102-
.map(|text| text.to_string())
102+
.map(ToString::to_string)
103103
.unwrap_or_default();
104104
render_paragraph_text(out, &text);
105105
}
@@ -147,7 +147,7 @@ fn render_option_entry(out: &mut String, arg: &Arg) {
147147
let help = arg
148148
.get_long_help()
149149
.or_else(|| arg.get_help())
150-
.map(|text| text.to_string())
150+
.map(ToString::to_string)
151151
.unwrap_or_default();
152152
writeln!(out, "{}", roff_escape(&help)).unwrap();
153153
render_possible_values(out, arg);

0 commit comments

Comments
 (0)