Skip to content

Commit

Permalink
core: avoid spurious f64 cast and comparison
Browse files Browse the repository at this point in the history
This tweaks `break_words()` logic by dropping a cast to f64
and a float comparison, directly using the integer width value
instead.
  • Loading branch information
lucab authored and mgeisler committed Jun 28, 2024
1 parent b7b0965 commit 51c425f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 51c425f

Please sign in to comment.