Skip to content

Commit

Permalink
Use destructuring to clean up InlineFragments::push_all
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanzab committed Jun 2, 2014
1 parent 782608e commit 0276ae4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/components/main/layout/inline.rs
Expand Up @@ -703,14 +703,10 @@ impl InlineFragments {
}

/// Merges another set of inline fragments with this one.
pub fn push_all(&mut self, other: InlineFragments) {
let InlineFragments {
fragments: other_fragments,
ranges: other_ranges,
} = other;
pub fn push_all(&mut self, InlineFragments { fragments, ranges }: InlineFragments) {
let adjustment = FragmentIndex(self.fragments.len() as int);
self.push_all_ranges(other_ranges, adjustment);
self.fragments.push_all_move(other_fragments);
self.push_all_ranges(ranges, adjustment);
self.fragments.push_all_move(fragments);
}

/// Returns an iterator that iterates over all fragments along with the appropriate context.
Expand Down

5 comments on commit 0276ae4

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at brendanzab@0276ae4

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging bjz/servo/remove-inline-fragment-map = 0276ae4 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bjz/servo/remove-inline-fragment-map = 0276ae4 merged ok, testing candidate = 184d8b5

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 184d8b5

Please sign in to comment.