From 6725f716e73132798d0501675d8a7c42174ddb8b Mon Sep 17 00:00:00 2001 From: danik292 <116908854+danik292@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:29:30 +0200 Subject: [PATCH] layout: Switch `.len()` comparison to `is_empty()` in `components/layout_2020/query.rs`. (#33544) * Improve readability of code Signed-off-by: Daniel Frantes * Fix style issue Signed-off-by: Martin Robinson --------- Signed-off-by: Daniel Frantes Signed-off-by: Martin Robinson Co-authored-by: Martin Robinson --- components/layout_2020/query.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/layout_2020/query.rs b/components/layout_2020/query.rs index dddba280e45..f221b3c5b93 100644 --- a/components/layout_2020/query.rs +++ b/components/layout_2020/query.rs @@ -741,7 +741,7 @@ fn rendered_text_collection_steps<'dom>( items.push(InnerOrOuterTextItem::Text(String::from(" "))); }; - if transformed_text.len() > 0 { + if !transformed_text.is_empty() { // Here we decide whether to keep or truncate the final white // space character, if there is one. if is_final_character_whitespace && !is_preformatted_element {