Skip to content

Commit

Permalink
remove unnecessary allocations (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie authored Jun 12, 2024
1 parent 8989c30 commit 5901e92
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}
}

Expand Down

0 comments on commit 5901e92

Please sign in to comment.