mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Eliminate warnings
This commit is contained in:
parent
2f46b9aede
commit
dc86e83654
57 changed files with 223 additions and 221 deletions
|
@ -317,7 +317,7 @@ impl IOCompositor {
|
|||
}
|
||||
|
||||
(Ok(Paint(pipeline_id, epoch, replies)), NotShuttingDown) => {
|
||||
for (layer_id, new_layer_buffer_set) in replies.move_iter() {
|
||||
for (layer_id, new_layer_buffer_set) in replies.into_iter() {
|
||||
self.paint(pipeline_id, layer_id, new_layer_buffer_set, epoch);
|
||||
}
|
||||
self.remove_outstanding_render_msg();
|
||||
|
@ -839,7 +839,7 @@ impl IOCompositor {
|
|||
let mut results:
|
||||
HashMap<PipelineId, (RenderChan, Vec<RenderRequest>)> = HashMap::new();
|
||||
|
||||
for (layer, mut layer_requests) in requests.move_iter() {
|
||||
for (layer, mut layer_requests) in requests.into_iter() {
|
||||
let pipeline_id = layer.extra_data.borrow().pipeline.id;
|
||||
let &(_, ref mut vec) = results.find_or_insert_with(pipeline_id, |_| {
|
||||
(layer.extra_data.borrow().pipeline.render_chan.clone(), Vec::new())
|
||||
|
@ -847,7 +847,7 @@ impl IOCompositor {
|
|||
|
||||
// All the BufferRequests are in layer/device coordinates, but the render task
|
||||
// wants to know the page coordinates. We scale them before sending them.
|
||||
for request in layer_requests.mut_iter() {
|
||||
for request in layer_requests.iter_mut() {
|
||||
request.page_rect = request.page_rect / scale.get();
|
||||
}
|
||||
|
||||
|
@ -895,7 +895,7 @@ impl IOCompositor {
|
|||
self.convert_buffer_requests_to_pipeline_requests_map(layers_and_requests);
|
||||
|
||||
let mut num_render_msgs_sent = 0;
|
||||
for (_pipeline_id, (chan, requests)) in pipeline_requests.move_iter() {
|
||||
for (_pipeline_id, (chan, requests)) in pipeline_requests.into_iter() {
|
||||
num_render_msgs_sent += 1;
|
||||
let _ = chan.send_opt(RenderMsg(requests));
|
||||
}
|
||||
|
@ -949,7 +949,7 @@ impl IOCompositor {
|
|||
// We must read from the back buffer (ie, before self.window.present()) as
|
||||
// OpenGL ES 2 does not have glReadBuffer().
|
||||
let (width, height) = (self.window_size.width.get(), self.window_size.height.get());
|
||||
let path = from_str::<Path>(self.opts.output_file.get_ref().as_slice()).unwrap();
|
||||
let path = from_str::<Path>(self.opts.output_file.as_ref().unwrap().as_slice()).unwrap();
|
||||
let mut pixels = gl2::read_pixels(0, 0,
|
||||
width as gl2::GLsizei,
|
||||
height as gl2::GLsizei,
|
||||
|
@ -962,7 +962,7 @@ impl IOCompositor {
|
|||
let src_start = (height - y - 1) * stride;
|
||||
unsafe {
|
||||
let src_slice = orig_pixels.slice(src_start, src_start + stride);
|
||||
pixels.mut_slice(dst_start, dst_start + stride)
|
||||
pixels.slice_mut(dst_start, dst_start + stride)
|
||||
.copy_memory(src_slice.slice_to(stride));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ impl CompositorData {
|
|||
}
|
||||
|
||||
{
|
||||
for buffer in new_buffers.buffers.move_iter().rev() {
|
||||
for buffer in new_buffers.buffers.into_iter().rev() {
|
||||
layer.add_buffer(buffer);
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ impl CompositorData {
|
|||
// We have no way of knowing without a race whether the render task is even up and
|
||||
// running, but mark the buffers as not leaking. If the render task died, then the
|
||||
// buffers are going to be cleaned up.
|
||||
for buffer in buffers.mut_iter() {
|
||||
for buffer in buffers.iter_mut() {
|
||||
buffer.mark_wont_leak()
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ impl CompositorData {
|
|||
/// This is used during shutdown, when we know the render task is going away.
|
||||
pub fn forget_all_tiles(layer: Rc<Layer<CompositorData>>) {
|
||||
let tiles = layer.collect_buffers();
|
||||
for tile in tiles.move_iter() {
|
||||
for tile in tiles.into_iter() {
|
||||
let mut tile = tile;
|
||||
tile.mark_wont_leak()
|
||||
}
|
||||
|
|
|
@ -116,9 +116,9 @@ impl FrameTreeTraversal for Rc<FrameTree> {
|
|||
fn replace_child(&self, id: PipelineId, new_child: Rc<FrameTree>) -> ReplaceResult {
|
||||
for frame_tree in self.iter() {
|
||||
let mut children = frame_tree.children.borrow_mut();
|
||||
let mut child = children.mut_iter()
|
||||
let mut child = children.iter_mut()
|
||||
.find(|child| child.frame_tree.pipeline.id == id);
|
||||
for child in child.mut_iter() {
|
||||
for child in child.iter_mut() {
|
||||
*new_child.parent.borrow_mut() = child.frame_tree.parent.borrow().clone();
|
||||
return ReplacedNode(replace(&mut child.frame_tree, new_child));
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ impl Iterator<Rc<FrameTree>> for FrameTreeIterator {
|
|||
fn next(&mut self) -> Option<Rc<FrameTree>> {
|
||||
if !self.stack.is_empty() {
|
||||
let next = self.stack.pop();
|
||||
for cft in next.get_ref().children.borrow().iter() {
|
||||
for cft in next.as_ref().unwrap().children.borrow().iter() {
|
||||
self.stack.push(cft.frame_tree.clone());
|
||||
}
|
||||
Some(next.unwrap())
|
||||
|
@ -190,14 +190,14 @@ impl NavigationContext {
|
|||
* when it is known that there exists either a previous page or a next page. */
|
||||
|
||||
fn back(&mut self) -> Rc<FrameTree> {
|
||||
self.next.push(self.current.take_unwrap());
|
||||
self.next.push(self.current.take().unwrap());
|
||||
let prev = self.previous.pop().unwrap();
|
||||
self.current = Some(prev.clone());
|
||||
prev
|
||||
}
|
||||
|
||||
fn forward(&mut self) -> Rc<FrameTree> {
|
||||
self.previous.push(self.current.take_unwrap());
|
||||
self.previous.push(self.current.take().unwrap());
|
||||
let next = self.next.pop().unwrap();
|
||||
self.current = Some(next.clone());
|
||||
next
|
||||
|
@ -208,7 +208,7 @@ impl NavigationContext {
|
|||
debug!("navigating to {:?}", frame_tree.pipeline.id);
|
||||
let evicted = replace(&mut self.next, vec!());
|
||||
if self.current.is_some() {
|
||||
self.previous.push(self.current.take_unwrap());
|
||||
self.previous.push(self.current.take().unwrap());
|
||||
}
|
||||
self.current = Some(frame_tree.clone());
|
||||
evicted
|
||||
|
@ -333,7 +333,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
let matching_pending_frames = self.pending_frames.iter().filter_map(|frame_change| {
|
||||
frame_change.after.find(pipeline_id)
|
||||
});
|
||||
matching_navi_frames.move_iter().chain(matching_pending_frames).collect()
|
||||
matching_navi_frames.into_iter().chain(matching_pending_frames).collect()
|
||||
}
|
||||
|
||||
/// Handles loading pages, navigation, and granting access to the compositor
|
||||
|
@ -527,7 +527,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
let source_frame = current_frame.find(pipeline_id);
|
||||
for source_frame in source_frame.iter() {
|
||||
let mut children = source_frame.children.borrow_mut();
|
||||
let found_child = children.mut_iter().find(|child| subpage_eq(child));
|
||||
let found_child = children.iter_mut().find(|child| subpage_eq(child));
|
||||
found_child.map(|child| update_child_rect(child, true));
|
||||
}
|
||||
}
|
||||
|
@ -535,7 +535,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
// Update all frames with matching pipeline- and subpage-ids
|
||||
for frame_tree in frames.iter() {
|
||||
let mut children = frame_tree.children.borrow_mut();
|
||||
let found_child = children.mut_iter().find(|child| subpage_eq(child));
|
||||
let found_child = children.iter_mut().find(|child| subpage_eq(child));
|
||||
found_child.map(|child| update_child_rect(child, false));
|
||||
}
|
||||
}
|
||||
|
@ -612,7 +612,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
fn handle_load_url_msg(&mut self, source_id: PipelineId, url: Url) {
|
||||
debug!("Constellation: received message to load {:s}", url.to_string());
|
||||
// Make sure no pending page would be overridden.
|
||||
let source_frame = self.current_frame().get_ref().find(source_id).expect(
|
||||
let source_frame = self.current_frame().as_ref().unwrap().find(source_id).expect(
|
||||
"Constellation: received a LoadUrlMsg from a pipeline_id associated
|
||||
with a pipeline not in the active frame tree. This should be
|
||||
impossible.");
|
||||
|
@ -621,7 +621,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
let old_id = frame_change.before.expect("Constellation: Received load msg
|
||||
from pipeline, but there is no currently active page. This should
|
||||
be impossible.");
|
||||
let changing_frame = self.current_frame().get_ref().find(old_id).expect("Constellation:
|
||||
let changing_frame = self.current_frame().as_ref().unwrap().find(old_id).expect("Constellation:
|
||||
Pending change has non-active source pipeline. This should be
|
||||
impossible.");
|
||||
if changing_frame.contains(source_id) || source_frame.contains(old_id) {
|
||||
|
@ -663,7 +663,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
debug!("no next page to navigate to");
|
||||
return;
|
||||
} else {
|
||||
let old = self.current_frame().get_ref();
|
||||
let old = self.current_frame().as_ref().unwrap();
|
||||
for frame in old.iter() {
|
||||
frame.pipeline.revoke_paint_permission();
|
||||
}
|
||||
|
@ -675,7 +675,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
debug!("no previous page to navigate to");
|
||||
return;
|
||||
} else {
|
||||
let old = self.current_frame().get_ref();
|
||||
let old = self.current_frame().as_ref().unwrap();
|
||||
for frame in old.iter() {
|
||||
frame.pipeline.revoke_paint_permission();
|
||||
}
|
||||
|
@ -721,7 +721,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
// Create the next frame tree that will be given to the compositor
|
||||
let next_frame_tree = if to_add.parent.borrow().is_some() {
|
||||
// NOTE: work around borrowchk issues
|
||||
self.current_frame().get_ref().clone()
|
||||
self.current_frame().as_ref().unwrap().clone()
|
||||
} else {
|
||||
to_add.clone()
|
||||
};
|
||||
|
@ -730,7 +730,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
match frame_change.before {
|
||||
Some(revoke_id) if self.current_frame().is_some() => {
|
||||
debug!("Constellation: revoking permission from {:?}", revoke_id);
|
||||
let current_frame = self.current_frame().get_ref();
|
||||
let current_frame = self.current_frame().as_ref().unwrap();
|
||||
|
||||
let to_revoke = current_frame.find(revoke_id).expect(
|
||||
"Constellation: pending frame change refers to an old \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue