mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
clippy: Fix filter_next warnings (#31965)
This commit is contained in:
parent
c7b73e1ef4
commit
0a40a800fd
4 changed files with 7 additions and 14 deletions
|
@ -118,8 +118,7 @@ impl FormDataMethods for FormData {
|
||||||
self.data
|
self.data
|
||||||
.borrow()
|
.borrow()
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|(datum_name, _)| datum_name.0 == name.0)
|
.find(|(datum_name, _)| datum_name.0 == name.0)
|
||||||
.next()
|
|
||||||
.map(|(_, datum)| match &datum.value {
|
.map(|(_, datum)| match &datum.value {
|
||||||
FormDatumValue::String(ref s) => {
|
FormDatumValue::String(ref s) => {
|
||||||
FileOrUSVString::USVString(USVString(s.to_string()))
|
FileOrUSVString::USVString(USVString(s.to_string()))
|
||||||
|
|
|
@ -170,8 +170,7 @@ impl HTMLLabelElement {
|
||||||
self.upcast::<Node>()
|
self.upcast::<Node>()
|
||||||
.traverse_preorder(ShadowIncluding::No)
|
.traverse_preorder(ShadowIncluding::No)
|
||||||
.filter_map(DomRoot::downcast::<HTMLElement>)
|
.filter_map(DomRoot::downcast::<HTMLElement>)
|
||||||
.filter(|elem| elem.is_labelable_element())
|
.find(|elem| elem.is_labelable_element())
|
||||||
.next()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3309,8 +3309,7 @@ impl<'a> ChildrenMutation<'a> {
|
||||||
..
|
..
|
||||||
} => next
|
} => next
|
||||||
.inclusively_following_siblings()
|
.inclusively_following_siblings()
|
||||||
.filter(|node| node.is::<Element>())
|
.find(|node| node.is::<Element>()),
|
||||||
.next(),
|
|
||||||
// Add/remove at end of container: Return the last preceding element.
|
// Add/remove at end of container: Return the last preceding element.
|
||||||
ChildrenMutation::Append { prev, .. } |
|
ChildrenMutation::Append { prev, .. } |
|
||||||
ChildrenMutation::Replace {
|
ChildrenMutation::Replace {
|
||||||
|
@ -3319,8 +3318,7 @@ impl<'a> ChildrenMutation<'a> {
|
||||||
..
|
..
|
||||||
} => prev
|
} => prev
|
||||||
.inclusively_preceding_siblings()
|
.inclusively_preceding_siblings()
|
||||||
.filter(|node| node.is::<Element>())
|
.find(|node| node.is::<Element>()),
|
||||||
.next(),
|
|
||||||
// Insert or replace in the middle:
|
// Insert or replace in the middle:
|
||||||
ChildrenMutation::Insert { prev, next, .. } |
|
ChildrenMutation::Insert { prev, next, .. } |
|
||||||
ChildrenMutation::Replace {
|
ChildrenMutation::Replace {
|
||||||
|
@ -3334,16 +3332,14 @@ impl<'a> ChildrenMutation<'a> {
|
||||||
{
|
{
|
||||||
// Before the first element: Return the first following element.
|
// Before the first element: Return the first following element.
|
||||||
next.inclusively_following_siblings()
|
next.inclusively_following_siblings()
|
||||||
.filter(|node| node.is::<Element>())
|
.find(|node| node.is::<Element>())
|
||||||
.next()
|
|
||||||
} else if next
|
} else if next
|
||||||
.inclusively_following_siblings()
|
.inclusively_following_siblings()
|
||||||
.all(|node| !node.is::<Element>())
|
.all(|node| !node.is::<Element>())
|
||||||
{
|
{
|
||||||
// After the last element: Return the last preceding element.
|
// After the last element: Return the last preceding element.
|
||||||
prev.inclusively_preceding_siblings()
|
prev.inclusively_preceding_siblings()
|
||||||
.filter(|node| node.is::<Element>())
|
.find(|node| node.is::<Element>())
|
||||||
.next()
|
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,8 +67,7 @@ impl XRFrame {
|
||||||
self.data
|
self.data
|
||||||
.sub_images
|
.sub_images
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|sub_images| sub_images.layer_id == layer_id)
|
.find(|sub_images| sub_images.layer_id == layer_id)
|
||||||
.next()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue