layout: Switch .len() comparison to is_empty() in components/layout_2020/query.rs. (#33544)

* Improve readability of code

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>

* Fix style issue

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
danik292 2024-09-25 22:29:30 +02:00 committed by GitHub
parent ac567645a7
commit 6725f716e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {