aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-09-04 10:51:24 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-09-04 18:30:46 +0530
commit8e2c37a542e6bb96681e78977aedaaf675236922 (patch)
treec17f68a4c3eaf7e58c1355325a48ea2e78139ecb /components/layout/construct.rs
parent5c24da3e2d01b5c583d8def9936a5355b3c27f87 (diff)
downloadservo-8e2c37a542e6bb96681e78977aedaaf675236922.tar.gz
servo-8e2c37a542e6bb96681e78977aedaaf675236922.zip
Fix match_refs and let_returns in layout, address review changes
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs23
1 files changed, 11 insertions, 12 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index eb43c81b93e..dd1d58a6acc 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -91,10 +91,10 @@ impl ConstructionResult {
}
pub fn debug_id(&self) -> usize {
- match self {
- &ConstructionResult::None => 0,
- &ConstructionResult::ConstructionItem(_) => 0,
- &ConstructionResult::Flow(ref flow_ref, _) => flow::base(&**flow_ref).debug_id(),
+ match *self {
+ ConstructionResult::None => 0,
+ ConstructionResult::ConstructionItem(_) => 0,
+ ConstructionResult::Flow(ref flow_ref, _) => flow::base(&**flow_ref).debug_id(),
}
}
}
@@ -1315,9 +1315,9 @@ impl<'a> FlowConstructor<'a> {
let mut layout_data_ref = node.mutate_layout_data();
let layout_data = layout_data_ref.as_mut().expect("no layout data");
let damage = layout_data.data.restyle_damage;
- match node.construction_result_mut(layout_data) {
- &mut ConstructionResult::None => true,
- &mut ConstructionResult::Flow(ref mut flow, _) => {
+ match *node.construction_result_mut(layout_data) {
+ ConstructionResult::None => true,
+ ConstructionResult::Flow(ref mut flow, _) => {
// The node's flow is of the same type and has the same set of children and can
// therefore be repaired by simply propagating damage and style to the flow.
if !flow.is_block_flow() {
@@ -1328,7 +1328,7 @@ impl<'a> FlowConstructor<'a> {
flow.repair_style_and_bubble_inline_sizes(&style);
true
}
- &mut ConstructionResult::ConstructionItem(ConstructionItem::InlineFragments(
+ ConstructionResult::ConstructionItem(ConstructionItem::InlineFragments(
ref mut inline_fragments_construction_result)) => {
if !inline_fragments_construction_result.splits.is_empty() {
return false
@@ -1384,7 +1384,7 @@ impl<'a> FlowConstructor<'a> {
}
true
}
- &mut ConstructionResult::ConstructionItem(_) => {
+ ConstructionResult::ConstructionItem(_) => {
false
}
}
@@ -1558,8 +1558,7 @@ trait NodeUtils {
/// Returns true if this node doesn't render its kids and false otherwise.
fn is_replaced_content(&self) -> bool;
- fn construction_result_mut<'a>(self, layout_data: &'a mut LayoutDataWrapper)
- -> &'a mut ConstructionResult;
+ fn construction_result_mut(self, layout_data: &mut LayoutDataWrapper) -> &mut ConstructionResult;
/// Sets the construction result of a flow.
fn set_flow_construction_result(self, result: ConstructionResult);
@@ -1589,7 +1588,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> {
}
}
- fn construction_result_mut<'a>(self, layout_data: &'a mut LayoutDataWrapper) -> &'a mut ConstructionResult {
+ fn construction_result_mut(self, layout_data: &mut LayoutDataWrapper) -> &mut ConstructionResult {
match self.get_pseudo_element_type() {
PseudoElementType::Before(_) => &mut layout_data.data.before_flow_construction_result,
PseudoElementType::After (_) => &mut layout_data.data.after_flow_construction_result,