Skip to content

Commit

Permalink
(git-testament): Clean up format strings a little
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Silverstone <[email protected]>
  • Loading branch information
kinnison committed Dec 30, 2022
1 parent c8088d2 commit c81f377
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ impl<'a> GitTestament<'a> {
}
)
} else if tag.contains(pkg_version) {
format!("{}", self)
format!("{self}")
} else {
format!("{} :: {}", pkg_version, self)
format!("{pkg_version} :: {self}")
}
}
_ => format!("{}", self),
_ => format!("{self}"),
}
}
}
Expand Down Expand Up @@ -190,10 +190,10 @@ impl<'a> Display for CommitKind<'a> {
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
match self {
CommitKind::NoRepository(crate_ver, build_date) => {
write!(fmt, "{} ({})", crate_ver, build_date)
write!(fmt, "{crate_ver} ({build_date})")
}
CommitKind::NoCommit(crate_ver, build_date) => {
write!(fmt, "{} (uncommitted {})", crate_ver, build_date)
write!(fmt, "{crate_ver} (uncommitted {build_date})")
}
CommitKind::NoTags(commit, when) => {
write!(fmt, "unknown ({} {})", &commit[..9], when)
Expand Down

0 comments on commit c81f377

Please sign in to comment.