From 5901e9200483ca4e2248dd8b1b45e87252bcb21b Mon Sep 17 00:00:00 2001 From: Aevyrie Date: Tue, 11 Jun 2024 22:18:36 -0700 Subject: [PATCH] remove unnecessary allocations (#58) --- src/lib.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index fdeb17b..70df0c3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -169,12 +169,11 @@ impl Limiter { impl std::fmt::Display for Limiter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let output = match self { - Limiter::Auto => "Auto".into(), - Limiter::Manual(t) => format!("{:.2} fps", 1.0 / t.as_secs_f32()), - Limiter::Off => "Off".into(), - }; - write!(f, "{}", output) + match self { + Limiter::Auto => write!(f, "Auto"), + Limiter::Manual(t) => write!(f, "{:.2} fps", 1.0 / t.as_secs_f32()), + Limiter::Off => write!(f, "Off"), + } } }