From 9486e751f2de576620057781e9143a41b42eb1e6 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 17 Aug 2025 14:51:42 +0200 Subject: [PATCH] Simplify impl of Display for some types Micro-optimization, I know. ;-D Signed-off-by: Matthias Beyer --- crates/radicle-cli/src/git.rs | 2 +- crates/radicle/src/cob/common.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/radicle-cli/src/git.rs b/crates/radicle-cli/src/git.rs index ac0b9ca7..d01d20b0 100644 --- a/crates/radicle-cli/src/git.rs +++ b/crates/radicle-cli/src/git.rs @@ -58,7 +58,7 @@ impl Rev { impl Display for Rev { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.0) + self.0.fmt(f) } } diff --git a/crates/radicle/src/cob/common.rs b/crates/radicle/src/cob/common.rs index 67f2f3b5..90924886 100644 --- a/crates/radicle/src/cob/common.rs +++ b/crates/radicle/src/cob/common.rs @@ -64,7 +64,7 @@ impl Author { impl Display for Author { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", self.id) + self.id.fmt(f) } } @@ -210,7 +210,7 @@ impl FromStr for Label { impl Display for Label { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", self.0) + self.0.fmt(f) } }