Skip to content

Commit

Permalink
Merge pull request #4761 from cakebaker/uudoc_fix_clippy_warnings
Browse files Browse the repository at this point in the history
uudoc: fix clippy warnings
  • Loading branch information
sylvestre authored Apr 21, 2023
2 parents fe7dd40 + 3272d14 commit 48f9786
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/bin/uudoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl<'a, 'b> MDWriter<'a, 'b> {

fn usage(&mut self) -> io::Result<()> {
if let Some(markdown) = &self.markdown {
let usage = help_parser::parse_usage(&markdown);
let usage = help_parser::parse_usage(markdown);
let usage = usage.replace("{}", self.name);

writeln!(self.w, "\n```")?;
Expand All @@ -191,15 +191,15 @@ impl<'a, 'b> MDWriter<'a, 'b> {

fn about(&mut self) -> io::Result<()> {
if let Some(markdown) = &self.markdown {
writeln!(self.w, "{}", help_parser::parse_about(&markdown))
writeln!(self.w, "{}", help_parser::parse_about(markdown))
} else {
Ok(())
}
}

fn after_help(&mut self) -> io::Result<()> {
if let Some(markdown) = &self.markdown {
if let Some(after_help) = help_parser::parse_section("after help", &markdown) {
if let Some(after_help) = help_parser::parse_section("after help", markdown) {
return writeln!(self.w, "\n\n{after_help}");
}
}
Expand Down Expand Up @@ -254,10 +254,10 @@ impl<'a, 'b> MDWriter<'a, 'b> {
write!(self.w, "<dt>")?;
let mut first = true;
for l in arg.get_long_and_visible_aliases().unwrap_or_default() {
if !first {
write!(self.w, ", ")?;
} else {
if first {
first = false;
} else {
write!(self.w, ", ")?;
}
write!(self.w, "<code>")?;
write!(self.w, "--{}", l)?;
Expand All @@ -275,10 +275,10 @@ impl<'a, 'b> MDWriter<'a, 'b> {
write!(self.w, "</code>")?;
}
for s in arg.get_short_and_visible_aliases().unwrap_or_default() {
if !first {
write!(self.w, ", ")?;
} else {
if first {
first = false;
} else {
write!(self.w, ", ")?;
}
write!(self.w, "<code>")?;
write!(self.w, "-{}", s)?;
Expand Down

0 comments on commit 48f9786

Please sign in to comment.