diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 2aeab109398..53c83fc5c39 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -32,7 +32,7 @@ use libc::uintptr_t; use msg::compositor_msg::{LayerId, LayerKind}; use net_traits::image::base::Image; use paint_task::PaintLayer; -use smallvec::SmallVec8; +use smallvec::SmallVec; use std::collections::linked_list::{self, LinkedList}; use std::fmt; use std::slice::Iter; @@ -313,7 +313,7 @@ impl StackingContext { } // Sort positioned children according to z-index. - let mut positioned_children = SmallVec8::new(); + let mut positioned_children: SmallVec<[Arc; 8]> = SmallVec::new(); for kid in display_list.children.iter() { positioned_children.push((*kid).clone()); } diff --git a/components/gfx/font.rs b/components/gfx/font.rs index f263cc8c607..fa60ba65abb 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use euclid::{Point2D, Rect, Size2D}; -use smallvec::SmallVec8; +use smallvec::SmallVec; use std::borrow::ToOwned; use std::mem; use std::slice; @@ -204,11 +204,11 @@ impl Font { } pub struct FontGroup { - pub fonts: SmallVec8>>, + pub fonts: SmallVec<[Rc>; 8]>, } impl FontGroup { - pub fn new(fonts: SmallVec8>>) -> FontGroup { + pub fn new(fonts: SmallVec<[Rc>; 8]>) -> FontGroup { FontGroup { fonts: fonts, } diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index 1bc555c65d9..5621807827f 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -13,7 +13,7 @@ use font_template::FontTemplateDescriptor; use fnv::FnvHasher; use platform::font::FontHandle; use platform::font_template::FontTemplateData; -use smallvec::SmallVec8; +use smallvec::SmallVec; use string_cache::Atom; use util::cache::HashCache; use util::geometry::Au; @@ -159,7 +159,7 @@ impl FontContext { style.font_style == font_style::T::italic || style.font_style == font_style::T::oblique); - let mut fonts = SmallVec8::new(); + let mut fonts: SmallVec<[Rc>; 8]> = SmallVec::new(); for family in style.font_family.0.iter() { // GWTODO: Check on real pages if this is faster as Vec() or HashMap(). diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index 68ccf3c5cd7..466b5fd7ece 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -11,7 +11,7 @@ use context::SharedLayoutContext; use css::node_style::StyledNode; use data::LayoutDataWrapper; use incremental::{self, RestyleDamage}; -use smallvec::SmallVec16; +use smallvec::SmallVec; use wrapper::{LayoutElement, LayoutNode}; use script::dom::characterdata::CharacterDataTypeId; @@ -38,7 +38,7 @@ use util::opts; use util::vec::ForgetfulSink; pub struct ApplicableDeclarations { - pub normal: SmallVec16, + pub normal: SmallVec<[DeclarationBlock; 16]>, pub before: Vec, pub after: Vec, @@ -49,7 +49,7 @@ pub struct ApplicableDeclarations { impl ApplicableDeclarations { pub fn new() -> ApplicableDeclarations { ApplicableDeclarations { - normal: SmallVec16::new(), + normal: SmallVec::new(), before: Vec::new(), after: Vec::new(), normal_shareable: false, @@ -57,7 +57,7 @@ impl ApplicableDeclarations { } pub fn clear(&mut self) { - self.normal = SmallVec16::new(); + self.normal = SmallVec::new(); self.before = Vec::new(); self.after = Vec::new(); self.normal_shareable = false; diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs index 2b2721b3e99..a5803d2484c 100644 --- a/components/layout/generated_content.rs +++ b/components/layout/generated_content.rs @@ -13,7 +13,7 @@ use flow::{self, AFFECTS_COUNTERS, Flow, HAS_COUNTER_AFFECTING_CHILDREN, Immutab use flow::{InorderFlowTraversal}; use fragment::{Fragment, GeneratedContentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo}; use incremental::{self, RESOLVE_GENERATED_CONTENT}; -use smallvec::SmallVec8; +use smallvec::SmallVec; use text::TextRunScanner; use gfx::display_list::OpaqueNode; @@ -522,7 +522,7 @@ pub fn static_representation(list_style_type: list_style_type::T) -> char { /// Pushes the string that represents the value rendered using the given *alphabetic system* onto /// the accumulator per CSS-COUNTER-STYLES ยง 3.1.4. fn push_alphabetic_representation(mut value: i32, system: &[char], accumulator: &mut String) { - let mut string = SmallVec8::new(); + let mut string: SmallVec<[char; 8]> = SmallVec::new(); while value != 0 { // Step 1. value = value - 1; @@ -545,7 +545,7 @@ fn push_numeric_representation(mut value: i32, system: &[char], accumulator: &mu } // Step 2. - let mut string = SmallVec8::new(); + let mut string: SmallVec<[char; 8]> = SmallVec::new(); while value != 0 { // Step 2.1. string.push(system[(value as usize) % system.len()]); diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index f7f8c527d9a..41bdc27a13e 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -57,7 +57,7 @@ use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask}; use net_traits::storage_task::StorageType; use script_traits::ScriptControlChan; use script_traits::UntrustedNodeAddress; -use smallvec::SmallVec1; +use smallvec::SmallVec; use msg::compositor_msg::ScriptListener; use msg::constellation_msg::ConstellationChan; use net_traits::image::base::Image; @@ -219,7 +219,7 @@ impl JSTraceable for Vec { // XXXManishearth Check if the following three are optimized to no-ops // if e.trace() is a no-op (e.g it is an no_jsmanaged_fields type) -impl JSTraceable for SmallVec1 { +impl JSTraceable for SmallVec<[T; 1]> { #[inline] fn trace(&self, trc: *mut JSTracer) { for e in self.iter() { diff --git a/components/style/stylesheets.rs b/components/style/stylesheets.rs index 301c6673b04..3093f8e69c3 100644 --- a/components/style/stylesheets.rs +++ b/components/style/stylesheets.rs @@ -18,7 +18,7 @@ use parser::{ParserContext, log_css_error}; use properties::{PropertyDeclarationBlock, parse_property_declaration_list}; use media_queries::{Device, MediaQueryList, parse_media_query_list}; use font_face::{FontFaceRule, parse_font_face_block}; -use smallvec::SmallVec2; +use smallvec::SmallVec; use viewport::ViewportRule; @@ -161,13 +161,13 @@ impl Stylesheet { /// conditional group rule will come before its nested rules. pub struct Rules<'a> { // 2 because normal case is likely to be just one level of nesting (@media) - stack: SmallVec2>, + stack: SmallVec<[slice::Iter<'a, CSSRule>; 2]>, device: Option<&'a Device> } impl<'a> Rules<'a> { fn new(iter: slice::Iter<'a, CSSRule>, device: Option<&'a Device>) -> Rules<'a> { - let mut stack = SmallVec2::new(); + let mut stack: SmallVec<[slice::Iter<'a, CSSRule>; 2]> = SmallVec::new(); stack.push(iter); Rules { stack: stack, device: device }