From 51c425fb0f84a59615456cde1c1f877fafc55062 Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Wed, 26 Jun 2024 11:48:57 +0200 Subject: [PATCH] core: avoid spurious f64 cast and comparison This tweaks `break_words()` logic by dropping a cast to f64 and a float comparison, directly using the integer width value instead. --- src/core.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.rs b/src/core.rs index 6b07f76..2ed441c 100644 --- a/src/core.rs +++ b/src/core.rs @@ -357,7 +357,7 @@ where { let mut shortened_words = Vec::new(); for word in words { - if word.width() > line_width as f64 { + if word.width > line_width { shortened_words.extend(word.break_apart(line_width)); } else { shortened_words.push(word);