mirror of
https://github.com/servo/servo.git
synced 2025-06-25 01:24:37 +01:00
Fix for #8593 'loop..match' should be 'while let'
changed line 641 of constellation.rs to while let added while let at line 1201 in constellation.rs added while let to line 1199 in block.rs
This commit is contained in:
parent
a5babb89a0
commit
99acd46c48
3 changed files with 29 additions and 47 deletions
|
@ -638,17 +638,11 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
|
|
||||||
self.close_pipeline(pipeline_id, ExitPipelineMode::Force);
|
self.close_pipeline(pipeline_id, ExitPipelineMode::Force);
|
||||||
|
|
||||||
loop {
|
while let Some(pending_pipeline_id) = self.pending_frames.iter().find(|pending| {
|
||||||
let pending_pipeline_id = self.pending_frames.iter().find(|pending| {
|
pending.old_pipeline_id == Some(pipeline_id)
|
||||||
pending.old_pipeline_id == Some(pipeline_id)
|
}).map(|frame| frame.new_pipeline_id) {
|
||||||
}).map(|frame| frame.new_pipeline_id);
|
debug!("removing pending frame change for failed pipeline");
|
||||||
match pending_pipeline_id {
|
self.close_pipeline(pending_pipeline_id, ExitPipelineMode::Force);
|
||||||
Some(pending_pipeline_id) => {
|
|
||||||
debug!("removing pending frame change for failed pipeline");
|
|
||||||
self.close_pipeline(pending_pipeline_id, ExitPipelineMode::Force);
|
|
||||||
},
|
|
||||||
None => break,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
debug!("creating replacement pipeline for about:failure");
|
debug!("creating replacement pipeline for about:failure");
|
||||||
|
|
||||||
|
@ -1198,20 +1192,14 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
// other hand, if no frames can be enabled after looping through all pending
|
// other hand, if no frames can be enabled after looping through all pending
|
||||||
// frames, we can safely exit the loop, knowing that we will need to wait on
|
// frames, we can safely exit the loop, knowing that we will need to wait on
|
||||||
// a dependent pipeline to be ready to paint.
|
// a dependent pipeline to be ready to paint.
|
||||||
loop {
|
while let Some(valid_frame_change) = self.pending_frames.iter().rposition(|frame_change| {
|
||||||
let valid_frame_change = self.pending_frames.iter().rposition(|frame_change| {
|
let waiting_on_dependency = frame_change.old_pipeline_id.map_or(false, |old_pipeline_id| {
|
||||||
let waiting_on_dependency = frame_change.old_pipeline_id.map_or(false, |old_pipeline_id| {
|
self.pipeline_to_frame_map.get(&old_pipeline_id).is_none()
|
||||||
self.pipeline_to_frame_map.get(&old_pipeline_id).is_none()
|
|
||||||
});
|
|
||||||
frame_change.painter_ready && !waiting_on_dependency
|
|
||||||
});
|
});
|
||||||
|
frame_change.painter_ready && !waiting_on_dependency
|
||||||
if let Some(valid_frame_change) = valid_frame_change {
|
}) {
|
||||||
let frame_change = self.pending_frames.swap_remove(valid_frame_change);
|
let frame_change = self.pending_frames.swap_remove(valid_frame_change);
|
||||||
self.add_or_replace_pipeline_in_frame_tree(frame_change);
|
self.add_or_replace_pipeline_in_frame_tree(frame_change);
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1196,24 +1196,19 @@ impl BlockFlow {
|
||||||
|
|
||||||
// Can't use `for` because we assign to
|
// Can't use `for` because we assign to
|
||||||
// `candidate_block_size_iterator.candidate_value`.
|
// `candidate_block_size_iterator.candidate_value`.
|
||||||
loop {
|
while let Some(block_size_used_val) = candidate_block_size_iterator.next() {
|
||||||
match candidate_block_size_iterator.next() {
|
solution = Some(
|
||||||
Some(block_size_used_val) => {
|
BSizeConstraintSolution::solve_vertical_constraints_abs_nonreplaced(
|
||||||
solution = Some(
|
block_size_used_val,
|
||||||
BSizeConstraintSolution::solve_vertical_constraints_abs_nonreplaced(
|
margin_block_start,
|
||||||
block_size_used_val,
|
margin_block_end,
|
||||||
margin_block_start,
|
block_start,
|
||||||
margin_block_end,
|
block_end,
|
||||||
block_start,
|
content_block_size,
|
||||||
block_end,
|
available_block_size));
|
||||||
content_block_size,
|
|
||||||
available_block_size));
|
|
||||||
|
|
||||||
candidate_block_size_iterator.candidate_value
|
candidate_block_size_iterator.candidate_value
|
||||||
= solution.unwrap().block_size;
|
= solution.unwrap().block_size;
|
||||||
}
|
|
||||||
None => break,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -524,18 +524,17 @@ pub mod specified {
|
||||||
let mut products = Vec::new();
|
let mut products = Vec::new();
|
||||||
products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));
|
products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));
|
||||||
|
|
||||||
loop {
|
while let Ok(token) = input.next() {
|
||||||
match input.next() {
|
match token {
|
||||||
Ok(Token::Delim('+')) => {
|
Token::Delim('+') => {
|
||||||
products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));
|
products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));
|
||||||
}
|
}
|
||||||
Ok(Token::Delim('-')) => {
|
Token::Delim('-') => {
|
||||||
let mut right = try!(CalcLengthOrPercentage::parse_product(input, expected_unit));
|
let mut right = try!(CalcLengthOrPercentage::parse_product(input, expected_unit));
|
||||||
right.values.push(CalcValueNode::Number(-1.));
|
right.values.push(CalcValueNode::Number(-1.));
|
||||||
products.push(right);
|
products.push(right);
|
||||||
}
|
}
|
||||||
Ok(_) => return Err(()),
|
_ => return Err(())
|
||||||
_ => break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue