aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/range.rs
diff options
context:
space:
mode:
authorkomuhangi <51232461+jahielkomu@users.noreply.github.com>2024-04-10 10:50:01 +0300
committerGitHub <noreply@github.com>2024-04-10 07:50:01 +0000
commit89a48205197a059c05f1ec6f07c14d82fb94d16b (patch)
tree47dcc5005d8199171aaf4fbed5138bdd1961fc21 /components/script/dom/range.rs
parent245269c64942f88bdd26d5962adc5440f2751aa3 (diff)
downloadservo-89a48205197a059c05f1ec6f07c14d82fb94d16b.tar.gz
servo-89a48205197a059c05f1ec6f07c14d82fb94d16b.zip
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
Diffstat (limited to 'components/script/dom/range.rs')
-rw-r--r--components/script/dom/range.rs14
1 files changed, 6 insertions, 8 deletions
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::<Text>);
- while let Some(child) = iter.next() {
+ for child in iter {
if self.contains(child.upcast()) {
s.push_str(&child.upcast::<CharacterData>().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;