Skip to content

Commit

Permalink
style: Inline fmt args
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 27, 2024
1 parent 1b20d31 commit fb86b69
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ impl fmt::Display for Commit<'_> {
f.write_str(self.type_().as_str())?;

if let Some(scope) = &self.scope() {
f.write_fmt(format_args!("({})", scope))?;
f.write_fmt(format_args!("({scope})"))?;
}

f.write_fmt(format_args!(": {}", &self.description()))?;

if let Some(body) = &self.body() {
f.write_fmt(format_args!("\n\n{}", body))?;
f.write_fmt(format_args!("\n\n{body}"))?;
}

for footer in self.footers() {
Expand Down Expand Up @@ -240,8 +240,7 @@ impl FromStr for FooterSeparator {
":" => Ok(FooterSeparator::Value),
" #" => Ok(FooterSeparator::Ref),
_ => {
Err(Error::new(ErrorKind::InvalidFooter)
.set_context(Box::new(format!("{:?}", sep))))
Err(Error::new(ErrorKind::InvalidFooter).set_context(Box::new(format!("{sep:?}"))))
}
}
}
Expand Down

0 comments on commit fb86b69

Please sign in to comment.