From fb86b69ddcd69911ad27d368f492ec75901b6957 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 27 Sep 2024 12:11:05 -0500 Subject: [PATCH] style: Inline fmt args --- src/commit.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/commit.rs b/src/commit.rs index 0ca00c4..d084c89 100644 --- a/src/commit.rs +++ b/src/commit.rs @@ -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() { @@ -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:?}")))) } } }