diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-11-08 05:11:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-08 05:11:11 -0500 |
commit | f220a63a0f4d7757c2a5e7c9da1c2063d37bebd6 (patch) | |
tree | b1a3c3010e6c29c4f9d86930f948116b6bf27a93 /components/layout/sequential.rs | |
parent | b1fd6237d1304f3d57abdafd3e6e738c1ece9f83 (diff) | |
parent | 9f977c52878e3638f475ca9a78e9f57d0d22893d (diff) | |
download | servo-f220a63a0f4d7757c2a5e7c9da1c2063d37bebd6.tar.gz servo-f220a63a0f4d7757c2a5e7c9da1c2063d37bebd6.zip |
Auto merge of #22133 - servo:extern-crate, r=SimonSapin
Use 2018-edition idioms in crates that use that edition
The first commit is almost entirely mechanical, created by running `cargo fix --edition-idioms` and relevant crates. I undid the change of adding an anonymous lifetime parameter in types that have implicit lifetimes parameters, for example replacing `&mut Formatter` with `&mut Formatter<'_>`, because I don’t like it. The remaining changes are, in many places:
* Add `dyn` to trait object types, for example `Rc<gl::Gl>` to `Rc<dyn gl::Gl>`. This change also works in the 2015 edition.
* Remove `extern crate` where is it made unneeded by changes to the import/module system.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22133)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/sequential.rs')
-rw-r--r-- | components/layout/sequential.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs index 3203dee5e49..9ade33d97a7 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -19,14 +19,14 @@ use servo_config::opts; use style::servo::restyle_damage::ServoRestyleDamage; use webrender_api::LayoutPoint; -pub fn resolve_generated_content(root: &mut Flow, layout_context: &LayoutContext) { +pub fn resolve_generated_content(root: &mut dyn Flow, layout_context: &LayoutContext) { ResolveGeneratedContent::new(&layout_context).traverse(root, 0); } /// Run the main layout passes sequentially. -pub fn reflow(root: &mut Flow, layout_context: &LayoutContext, relayout_mode: RelayoutMode) { +pub fn reflow(root: &mut dyn Flow, layout_context: &LayoutContext, relayout_mode: RelayoutMode) { fn doit( - flow: &mut Flow, + flow: &mut dyn Flow, assign_inline_sizes: AssignISizes, assign_block_sizes: AssignBSizes, relayout_mode: RelayoutMode, @@ -70,7 +70,7 @@ pub fn reflow(root: &mut Flow, layout_context: &LayoutContext, relayout_mode: Re } pub fn build_display_list_for_subtree<'a>( - flow_root: &mut Flow, + flow_root: &mut dyn Flow, layout_context: &'a LayoutContext, ) -> DisplayListBuildState<'a> { let mut state = StackingContextCollectionState::new(layout_context.id); @@ -83,13 +83,13 @@ pub fn build_display_list_for_subtree<'a>( } pub fn iterate_through_flow_tree_fragment_border_boxes( - root: &mut Flow, - iterator: &mut FragmentBorderBoxIterator, + root: &mut dyn Flow, + iterator: &mut dyn FragmentBorderBoxIterator, ) { fn doit( - flow: &mut Flow, + flow: &mut dyn Flow, level: i32, - iterator: &mut FragmentBorderBoxIterator, + iterator: &mut dyn FragmentBorderBoxIterator, stacking_context_position: &Point2D<Au>, ) { flow.iterate_through_fragment_border_boxes(iterator, level, stacking_context_position); @@ -119,7 +119,7 @@ pub fn iterate_through_flow_tree_fragment_border_boxes( doit(root, 0, iterator, &Point2D::zero()); } -pub fn store_overflow(layout_context: &LayoutContext, flow: &mut Flow) { +pub fn store_overflow(layout_context: &LayoutContext, flow: &mut dyn Flow) { if !flow .base() .restyle_damage @@ -142,7 +142,7 @@ pub fn store_overflow(layout_context: &LayoutContext, flow: &mut Flow) { /// Guesses how much inline size will be taken up by floats on the left and right sides of the /// given flow. This is needed to speculatively calculate the inline sizes of block formatting /// contexts. The speculation typically succeeds, but if it doesn't we have to lay it out again. -pub fn guess_float_placement(flow: &mut Flow) { +pub fn guess_float_placement(flow: &mut dyn Flow) { if !flow .base() .restyle_damage |