aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/components/gfx/buffer_map.rs2
-rw-r--r--src/components/gfx/render_task.rs2
-rw-r--r--src/components/gfx/text/glyph.rs10
-rw-r--r--src/components/gfx/text/shaping/harfbuzz.rs2
-rw-r--r--src/components/main/compositing/compositor_layer.rs2
-rw-r--r--src/components/script/script_task.rs2
-rw-r--r--src/components/style/selectors.rs10
-rw-r--r--src/components/style/stylesheets.rs2
-rw-r--r--src/components/util/time.rs2
9 files changed, 17 insertions, 17 deletions
diff --git a/src/components/gfx/buffer_map.rs b/src/components/gfx/buffer_map.rs
index 33ab8a4b5d2..9b3a6f60988 100644
--- a/src/components/gfx/buffer_map.rs
+++ b/src/components/gfx/buffer_map.rs
@@ -54,7 +54,7 @@ impl BufferKey {
/// A helper struct to keep track of buffers in the HashMap
struct BufferValue<T> {
/// An array of buffers, all the same size
- buffers: Vec<T>,
+ buffers: Vec<T>,
/// The counter when this size was last requested
last_action: uint,
}
diff --git a/src/components/gfx/render_task.rs b/src/components/gfx/render_task.rs
index 958989bf3fb..6d38286c0f9 100644
--- a/src/components/gfx/render_task.rs
+++ b/src/components/gfx/render_task.rs
@@ -256,7 +256,7 @@ impl<C: RenderListener + Send> RenderTask<C> {
}
}
UnusedBufferMsg(unused_buffers) => {
- for buffer in unused_buffers.move_iter() {
+ for buffer in unused_buffers.move_iter().rev() {
self.buffer_map.insert(native_graphics_context!(self), buffer);
}
}
diff --git a/src/components/gfx/text/glyph.rs b/src/components/gfx/text/glyph.rs
index f48cee8997e..1d1b99a8abc 100644
--- a/src/components/gfx/text/glyph.rs
+++ b/src/components/gfx/text/glyph.rs
@@ -555,20 +555,20 @@ impl<'a> GlyphStore {
self.entry_buffer[i] = entry;
}
- pub fn add_glyphs_for_char_index(&mut self, i: uint, data_for_glyphs: &Vec<GlyphData>) {
+ pub fn add_glyphs_for_char_index(&mut self, i: uint, data_for_glyphs: &[GlyphData]) {
assert!(i < self.entry_buffer.len());
assert!(data_for_glyphs.len() > 0);
let glyph_count = data_for_glyphs.len();
- let first_glyph_data = data_for_glyphs.get(0);
+ let first_glyph_data = data_for_glyphs[0];
let entry = match first_glyph_data.is_missing {
true => GlyphEntry::missing(glyph_count),
false => {
let glyphs_vec = slice::from_fn(glyph_count, |i| {
- DetailedGlyph::new(data_for_glyphs.get(i).index,
- data_for_glyphs.get(i).advance,
- data_for_glyphs.get(i).offset)
+ DetailedGlyph::new(data_for_glyphs[i].index,
+ data_for_glyphs[i].advance,
+ data_for_glyphs[i].offset)
});
self.detail_store.add_detailed_glyphs_for_entry(i, glyphs_vec);
diff --git a/src/components/gfx/text/shaping/harfbuzz.rs b/src/components/gfx/text/shaping/harfbuzz.rs
index 2eefc4f95e3..6a89a335911 100644
--- a/src/components/gfx/text/shaping/harfbuzz.rs
+++ b/src/components/gfx/text/shaping/harfbuzz.rs
@@ -425,7 +425,7 @@ impl Shaper {
}
// now add the detailed glyph entry.
- glyphs.add_glyphs_for_char_index(char_idx, &datas);
+ glyphs.add_glyphs_for_char_index(char_idx, datas.as_slice());
// set the other chars, who have no glyphs
let mut i = covered_byte_span.begin();
diff --git a/src/components/main/compositing/compositor_layer.rs b/src/components/main/compositing/compositor_layer.rs
index a1ef5b95bd3..160024c1815 100644
--- a/src/components/main/compositing/compositor_layer.rs
+++ b/src/components/main/compositing/compositor_layer.rs
@@ -842,7 +842,7 @@ impl CompositorLayer {
};
let mut unused_tiles = vec!();
- for buffer in new_buffers.buffers.move_iter() {
+ for buffer in new_buffers.buffers.move_iter().rev() {
unused_tiles.push_all_move(quadtree.add_tile_pixel(buffer.screen_pos.origin.x,
buffer.screen_pos.origin.y,
buffer.resolution,
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs
index 051bc9b58d2..09d9ee59aa6 100644
--- a/src/components/script/script_task.rs
+++ b/src/components/script/script_task.rs
@@ -1133,7 +1133,7 @@ impl ScriptTask {
match page.get_nodes_under_mouse(&point) {
Some(node_address) => {
- let mut target_list: Vec<JS<Node>> = vec!();
+ let mut target_list = vec!();
let mut target_compare = false;
let mouse_over_targets = &mut *self.mouse_over_targets.borrow_mut();
diff --git a/src/components/style/selectors.rs b/src/components/style/selectors.rs
index 88384a37d18..b7d9d986ce5 100644
--- a/src/components/style/selectors.rs
+++ b/src/components/style/selectors.rs
@@ -197,18 +197,18 @@ fn compute_specificity(mut selector: &CompoundSelector,
};
if pseudo_element.is_some() { specificity.element_selectors += 1 }
- simple_selectors_specificity(&selector.simple_selectors, &mut specificity);
+ simple_selectors_specificity(selector.simple_selectors.as_slice(), &mut specificity);
loop {
match selector.next {
None => break,
Some((ref next_selector, _)) => {
selector = &**next_selector;
- simple_selectors_specificity(&selector.simple_selectors, &mut specificity)
+ simple_selectors_specificity(selector.simple_selectors.as_slice(), &mut specificity)
}
}
}
- fn simple_selectors_specificity(simple_selectors: &Vec<SimpleSelector>,
+ fn simple_selectors_specificity(simple_selectors: &[SimpleSelector],
specificity: &mut Specificity) {
for simple_selector in simple_selectors.iter() {
match simple_selector {
@@ -226,7 +226,7 @@ fn compute_specificity(mut selector: &CompoundSelector,
=> specificity.class_like_selectors += 1,
&NamespaceSelector(..) => (),
&Negation(ref negated)
- => simple_selectors_specificity(negated, specificity),
+ => simple_selectors_specificity(negated.as_slice(), specificity),
}
}
}
@@ -680,7 +680,7 @@ mod tests {
// Default namespace does apply to type selectors
assert!(parse_ns("e", &namespaces) == Some(vec!(Selector{
compound_selectors: Arc::new(CompoundSelector {
- simple_selectors: vec!(
+ simple_selectors: vec!(
NamespaceSelector(namespace::MathML),
LocalNameSelector("e".to_owned()),
),
diff --git a/src/components/style/stylesheets.rs b/src/components/style/stylesheets.rs
index 6f4c97acb12..80ebf02c866 100644
--- a/src/components/style/stylesheets.rs
+++ b/src/components/style/stylesheets.rs
@@ -44,7 +44,7 @@ impl Stylesheet {
pub fn from_bytes_iter<I: Iterator<Vec<u8>>>(
mut input: I, base_url: Url, protocol_encoding_label: Option<&str>,
environment_encoding: Option<EncodingRef>) -> Stylesheet {
- let mut bytes = vec!();
+ let mut bytes = vec!();
// TODO: incremental decoding and tokinization/parsing
for chunk in input {
bytes.push_all(chunk.as_slice())
diff --git a/src/components/util/time.rs b/src/components/util/time.rs
index a9aa8d870ed..151e4385b56 100644
--- a/src/components/util/time.rs
+++ b/src/components/util/time.rs
@@ -200,7 +200,7 @@ impl Profiler {
if data_len > 0 {
let (mean, median, min, max) =
(data.iter().map(|&x|x).sum() / (data_len as f64),
- data.get(data_len / 2).clone(),
+ *data.get(data_len / 2),
data.iter().fold(f64::INFINITY, |a, &b| a.min(b)),
data.iter().fold(-f64::INFINITY, |a, &b| a.max(b)));
println!("{:-35s}: {:15.4f} {:15.4f} {:15.4f} {:15.4f} {:15u}",