From 89a48205197a059c05f1ec6f07c14d82fb94d16b Mon Sep 17 00:00:00 2001 From: komuhangi <51232461+jahielkomu@users.noreply.github.com> Date: Wed, 10 Apr 2024 10:50:01 +0300 Subject: Fixed some clippy warnings in components (#32025) * Fixed some clippy warnings in components * Updated the simplification of bolean expressions in componets/script/dom/range.rs --- components/script/dom/range.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'components/script/dom/range.rs') diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs index fa7d14795d3..3f6b274e958 100644 --- a/components/script/dom/range.rs +++ b/components/script/dom/range.rs @@ -1021,11 +1021,11 @@ impl RangeMethods for Range { // Step 4. let ancestor = self.CommonAncestorContainer(); - let mut iter = start_node + let iter = start_node .following_nodes(&ancestor) .filter_map(DomRoot::downcast::); - while let Some(child) = iter.next() { + for child in iter { if self.contains(child.upcast()) { s.push_str(&child.upcast::().Data()); } @@ -1189,9 +1189,8 @@ impl WeakRangeVec { let move_start = node_is_start && range.start_offset() == offset; let move_end = node_is_end && range.end_offset() == offset; - let remove_from_node = move_start && move_end || - move_start && !node_is_end || - move_end && !node_is_start; + let remove_from_node = + move_start && (move_end || !node_is_end) || move_end && !node_is_start; let already_in_child = range.start().node() == child || range.end().node() == child; let push_to_child = !already_in_child && (move_start || move_end); @@ -1252,9 +1251,8 @@ impl WeakRangeVec { let move_start = node_is_start && start_offset > offset; let move_end = node_is_end && end_offset > offset; - let remove_from_node = move_start && move_end || - move_start && !node_is_end || - move_end && !node_is_start; + let remove_from_node = + move_start && (move_end || !node_is_end) || move_end && !node_is_start; let already_in_sibling = range.start().node() == sibling || range.end().node() == sibling; -- cgit v1.2.3