mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #8805 - Ms2ger:drain_modified_elements, r=jdm
Simplify drain_modified_elements a bit. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8805) <!-- Reviewable:end -->
This commit is contained in:
commit
9c26903472
1 changed files with 2 additions and 3 deletions
|
@ -1415,9 +1415,8 @@ impl LayoutDocumentHelpers for LayoutJS<Document> {
|
|||
#[allow(unrooted_must_root)]
|
||||
unsafe fn drain_modified_elements(&self) -> Vec<(LayoutJS<Element>, ElementSnapshot)> {
|
||||
let mut elements = (*self.unsafe_get()).modified_elements.borrow_mut_for_layout();
|
||||
let drain = elements.drain();
|
||||
let layout_drain = drain.map(|(k, v)| (k.to_layout(), v));
|
||||
Vec::from_iter(layout_drain)
|
||||
let result = elements.drain().map(|(k, v)| (k.to_layout(), v)).collect();
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue