From 9504315f7e1b34d31e59a8934a0ec0b24a3b499a Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 14 Mar 2023 08:22:10 -0500 Subject: [PATCH] chore: Update Styled pattern --- crates/typos-cli/src/bin/typos-cli/report.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/typos-cli/src/bin/typos-cli/report.rs b/crates/typos-cli/src/bin/typos-cli/report.rs index 7e5e0fc..0b942f5 100644 --- a/crates/typos-cli/src/bin/typos-cli/report.rs +++ b/crates/typos-cli/src/bin/typos-cli/report.rs @@ -53,13 +53,10 @@ impl std::fmt::Display for Styled { #[inline] fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { if f.alternate() { - write!( - f, - "{}{}{}", - self.style.render(), - self.display, - self.style.render_reset() - ) + write!(f, "{}", self.style.render())?; + self.display.fmt(f)?; + write!(f, "{}", self.style.render_reset())?; + Ok(()) } else { self.display.fmt(f) }