mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Use destructuring to clean up InlineFragments::push_all
This commit is contained in:
parent
782608eba5
commit
0276ae47a2
1 changed files with 3 additions and 7 deletions
|
@ -703,14 +703,10 @@ impl InlineFragments {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Merges another set of inline fragments with this one.
|
/// Merges another set of inline fragments with this one.
|
||||||
pub fn push_all(&mut self, other: InlineFragments) {
|
pub fn push_all(&mut self, InlineFragments { fragments, ranges }: InlineFragments) {
|
||||||
let InlineFragments {
|
|
||||||
fragments: other_fragments,
|
|
||||||
ranges: other_ranges,
|
|
||||||
} = other;
|
|
||||||
let adjustment = FragmentIndex(self.fragments.len() as int);
|
let adjustment = FragmentIndex(self.fragments.len() as int);
|
||||||
self.push_all_ranges(other_ranges, adjustment);
|
self.push_all_ranges(ranges, adjustment);
|
||||||
self.fragments.push_all_move(other_fragments);
|
self.fragments.push_all_move(fragments);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator that iterates over all fragments along with the appropriate context.
|
/// Returns an iterator that iterates over all fragments along with the appropriate context.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue