diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs index 38da38ae6e1..41115b39db1 100644 --- a/components/canvas_traits/lib.rs +++ b/components/canvas_traits/lib.rs @@ -66,13 +66,13 @@ pub enum FromPaintMsg { } impl Serialize for FromPaintMsg { - fn serialize(&self, _: &mut S) -> Result<(),S::Error> where S: Serializer { + fn serialize(&self, _: &mut S) -> Result<(), S::Error> where S: Serializer { panic!("can't serialize a `FromPaintMsg`!") } } impl Deserialize for FromPaintMsg { - fn deserialize(_: &mut D) -> Result where D: Deserializer { + fn deserialize(_: &mut D) -> Result where D: Deserializer { panic!("can't deserialize a `FromPaintMsg`!") } } diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 91e885c880e..8721b6d1090 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -52,7 +52,7 @@ use url::Url; use util::geometry::{Au, PagePx, ScreenPx, ViewportPx}; use util::opts; -const BUFFER_MAP_SIZE : usize = 10000000; +const BUFFER_MAP_SIZE: usize = 10000000; /// Holds the state when running reftests that determines when it is /// safe to save the output image. @@ -163,8 +163,8 @@ pub struct IOCompositor { } pub struct ScrollEvent { - delta: TypedPoint2D, - cursor: TypedPoint2D, + delta: TypedPoint2D, + cursor: TypedPoint2D, } #[derive(PartialEq)] @@ -249,7 +249,7 @@ pub fn reporter_name() -> String { impl IOCompositor { fn new(window: Rc, - sender: Box, + sender: Box, receiver: Box, constellation_chan: ConstellationChan, time_profiler_chan: time::ProfilerChan, @@ -312,7 +312,7 @@ impl IOCompositor { } pub fn create(window: Rc, - sender: Box, + sender: Box, receiver: Box, constellation_chan: ConstellationChan, time_profiler_chan: time::ProfilerChan, diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs index 3b4ea12a9f2..080000d270f 100644 --- a/components/compositing/compositor_layer.rs +++ b/components/compositing/compositor_layer.rs @@ -365,7 +365,7 @@ impl CompositorLayer for Layer { let content_size = calculate_content_size_for_layer(self); let min_x = (layer_size.width - content_size.width).get().min(0.0); let min_y = (layer_size.height - content_size.height).get().min(0.0); - let new_offset : TypedPoint2D = + let new_offset: TypedPoint2D = Point2D::new(Length::new(new_offset.x.get().clamp(&min_x, &0.0)), Length::new(new_offset.y.get().clamp(&min_y, &0.0))); diff --git a/components/compositing/compositor_task.rs b/components/compositing/compositor_task.rs index d559630bfcf..fcf745a9bc2 100644 --- a/components/compositing/compositor_task.rs +++ b/components/compositing/compositor_task.rs @@ -37,7 +37,7 @@ pub trait CompositorProxy : 'static + Send { /// Sends a message to the compositor. fn send(&self, msg: Msg); /// Clones the compositor proxy. - fn clone_compositor_proxy(&self) -> Box; + fn clone_compositor_proxy(&self) -> Box; } /// The port that the compositor receives messages on. As above, this is a trait supplied by the @@ -88,7 +88,7 @@ pub fn run_script_listener_thread(compositor_proxy: Box { +impl PaintListener for Box { fn native_display(&mut self) -> Option { let (chan, port) = channel(); self.send(Msg::GetNativeDisplay(chan)); @@ -204,7 +204,7 @@ pub enum Msg { } impl Debug for Msg { - fn fmt(&self, f: &mut Formatter) -> Result<(),Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { match *self { Msg::Exit(..) => write!(f, "Exit"), Msg::ShutdownComplete(..) => write!(f, "ShutdownComplete"), @@ -240,7 +240,7 @@ pub struct CompositorTask; impl CompositorTask { pub fn create(window: Option>, - sender: Box, + sender: Box, receiver: Box, constellation_chan: ConstellationChan, time_profiler_chan: time::ProfilerChan, diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 9794d23af50..5d214f397f6 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -219,7 +219,7 @@ enum ExitPipelineMode { } impl Constellation { - pub fn start(compositor_proxy: Box, + pub fn start(compositor_proxy: Box, resource_task: ResourceTask, image_cache_task: ImageCacheTask, font_cache_task: FontCacheTask, @@ -1019,7 +1019,7 @@ impl Constellation { fn load_url_for_webdriver(&mut self, pipeline_id: PipelineId, - load_data:LoadData, + load_data: LoadData, reply: IpcSender) { let new_pipeline_id = self.load_url(pipeline_id, load_data); if let Some(id) = new_pipeline_id { diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index 6d398b6f42b..9eedfff8f5a 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -67,23 +67,23 @@ impl Pipeline { /// Starts a paint task, layout task, and possibly a script task. /// Returns the channels wrapped in a struct. /// If script_pipeline is not None, then subpage_id must also be not None. - pub fn create(id: PipelineId, - parent_info: Option<(PipelineId, SubpageId)>, - constellation_chan: ConstellationChan, - compositor_proxy: Box, - devtools_chan: Option>, - image_cache_task: ImageCacheTask, - font_cache_task: FontCacheTask, - resource_task: ResourceTask, - storage_task: StorageTask, - time_profiler_chan: time::ProfilerChan, - mem_profiler_chan: profile_mem::ProfilerChan, - window_rect: Option>, - script_chan: Option>, - load_data: LoadData, - device_pixel_ratio: ScaleFactor) - -> (Pipeline, PipelineContent) - where LTF: LayoutTaskFactory, STF:ScriptTaskFactory { + pub fn create(id: PipelineId, + parent_info: Option<(PipelineId, SubpageId)>, + constellation_chan: ConstellationChan, + compositor_proxy: Box, + devtools_chan: Option>, + image_cache_task: ImageCacheTask, + font_cache_task: FontCacheTask, + resource_task: ResourceTask, + storage_task: StorageTask, + time_profiler_chan: time::ProfilerChan, + mem_profiler_chan: profile_mem::ProfilerChan, + window_rect: Option>, + script_chan: Option>, + load_data: LoadData, + device_pixel_ratio: ScaleFactor) + -> (Pipeline, PipelineContent) + where LTF: LayoutTaskFactory, STF: ScriptTaskFactory { let (layout_to_paint_chan, layout_to_paint_port) = util::ipc::optional_ipc_channel(); let (chrome_to_paint_chan, chrome_to_paint_port) = channel(); let (paint_shutdown_chan, paint_shutdown_port) = channel(); @@ -305,7 +305,7 @@ pub struct PipelineContent { } impl PipelineContent { - pub fn start_all(mut self) where LTF: LayoutTaskFactory, STF: ScriptTaskFactory { + pub fn start_all(mut self) where LTF: LayoutTaskFactory, STF: ScriptTaskFactory { let layout_pair = ScriptTaskFactory::create_layout_channel(None::<&mut STF>); let (script_to_compositor_chan, script_to_compositor_port) = ipc::channel().unwrap(); diff --git a/components/compositing/scrolling.rs b/components/compositing/scrolling.rs index e9b533d9f1a..f19a8b9b9da 100644 --- a/components/compositing/scrolling.rs +++ b/components/compositing/scrolling.rs @@ -30,7 +30,7 @@ enum ToScrollingTimerMsg { } impl ScrollingTimerProxy { - pub fn new(compositor_proxy: Box) -> ScrollingTimerProxy { + pub fn new(compositor_proxy: Box) -> ScrollingTimerProxy { let (to_scrolling_timer_sender, to_scrolling_timer_receiver) = channel(); Builder::new().spawn(move || { let mut scrolling_timer = ScrollingTimer { diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index 5e815f79677..71ef9b15e11 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -75,7 +75,7 @@ pub enum WindowEvent { } impl Debug for WindowEvent { - fn fmt(&self, f: &mut Formatter) -> Result<(),Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { match *self { WindowEvent::Idle => write!(f, "Idle"), WindowEvent::Refresh => write!(f, "Refresh"), @@ -130,7 +130,7 @@ pub trait WindowMethods { /// This is part of the windowing system because its implementation often involves OS-specific /// magic to wake the up window's event loop. fn create_compositor_channel(_: &Option>) - -> (Box, Box); + -> (Box, Box); /// Requests that the window system prepare a composite. Typically this will involve making /// some type of platform-specific graphics context current. Returns true if the composite may diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs index a4201214727..5a290672c6b 100644 --- a/components/devtools/actor.rs +++ b/components/devtools/actor.rs @@ -86,8 +86,8 @@ impl Actor + Send { /// A list of known, owned actors. pub struct ActorRegistry { - actors: HashMap>, - new_actors: RefCell>>, + actors: HashMap>, + new_actors: RefCell>>, old_actors: RefCell>, script_actors: RefCell>, shareable: Option>>, @@ -167,11 +167,11 @@ impl ActorRegistry { } /// Add an actor to the registry of known actors that can receive messages. - pub fn register(&mut self, actor: Box) { + pub fn register(&mut self, actor: Box) { self.actors.insert(actor.name().to_string(), actor); } - pub fn register_later(&self, actor: Box) { + pub fn register_later(&self, actor: Box) { let mut actors = self.new_actors.borrow_mut(); actors.push(actor); } diff --git a/components/devtools/actors/inspector.rs b/components/devtools/actors/inspector.rs index c8508cebefa..1c17b71439e 100644 --- a/components/devtools/actors/inspector.rs +++ b/components/devtools/actors/inspector.rs @@ -93,7 +93,7 @@ impl Actor for HighlighterActor { } #[derive(RustcEncodable)] -struct ModifyAttributeReply{ +struct ModifyAttributeReply { from: String, } @@ -119,7 +119,7 @@ impl Actor for NodeActor { registry.actor_to_script(target.to_string()), modifications)) .unwrap(); - let reply = ModifyAttributeReply{ + let reply = ModifyAttributeReply { from: self.name(), }; stream.write_json_packet(&reply); diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index f8d9d6ec8d4..b5cbc48cfba 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -471,11 +471,11 @@ impl StackingContext { mut point: Point2D, result: &mut Vec, topmost_only: bool) { - fn hit_test_in_list<'a,I>(point: Point2D, - result: &mut Vec, - topmost_only: bool, - iterator: I) - where I: Iterator { + fn hit_test_in_list<'a, I>(point: Point2D, + result: &mut Vec, + topmost_only: bool, + iterator: I) + where I: Iterator { for item in iterator { // TODO(pcwalton): Use a precise algorithm here. This will allow us to properly hit // test elements with `border-radius`, for example. @@ -1016,7 +1016,7 @@ pub enum BoxShadowClipMode { pub enum DisplayItemIterator<'a> { Empty, - Parent(linked_list::Iter<'a,DisplayItem>), + Parent(linked_list::Iter<'a, DisplayItem>), } impl<'a> Iterator for DisplayItemIterator<'a> { diff --git a/components/gfx/display_list/optimizer.rs b/components/gfx/display_list/optimizer.rs index 37661ce6402..71f275a1bb6 100644 --- a/components/gfx/display_list/optimizer.rs +++ b/components/gfx/display_list/optimizer.rs @@ -45,10 +45,10 @@ impl DisplayListOptimizer { } /// Adds display items that intersect the visible rect to `result_list`. - fn add_in_bounds_display_items<'a,I>(&self, - result_list: &mut LinkedList, - display_items: I) - where I: Iterator { + fn add_in_bounds_display_items<'a, I>(&self, + result_list: &mut LinkedList, + display_items: I) + where I: Iterator { for display_item in display_items { if self.visible_rect.intersects(&display_item.base().bounds) && display_item.base().clip.might_intersect_rect(&self.visible_rect) { @@ -58,10 +58,10 @@ impl DisplayListOptimizer { } /// Adds child stacking contexts whose boundaries intersect the visible rect to `result_list`. - fn add_in_bounds_stacking_contexts<'a,I>(&self, - result_list: &mut LinkedList>, - stacking_contexts: I) - where I: Iterator> { + fn add_in_bounds_stacking_contexts<'a, I>(&self, + result_list: &mut LinkedList>, + stacking_contexts: I) + where I: Iterator> { for stacking_context in stacking_contexts { if stacking_context.layer.is_none() { // Transform this stacking context to get it into the same space as diff --git a/components/gfx/font.rs b/components/gfx/font.rs index 17625dc7fe4..a2022ead6f2 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -95,8 +95,8 @@ pub struct Font { pub requested_pt_size: Au, pub actual_pt_size: Au, pub shaper: Option, - pub shape_cache: HashCache>, - pub glyph_advance_cache: HashCache, + pub shape_cache: HashCache>, + pub glyph_advance_cache: HashCache, } bitflags! { diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index 7d5a26fe06f..089bc72a789 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -82,7 +82,7 @@ pub struct FontContext { paint_font_cache: Vec, layout_font_group_cache: - HashMap,DefaultState>, + HashMap, DefaultState>, } impl FontContext { @@ -273,7 +273,7 @@ impl FontContext { } let paint_font = Rc::new(RefCell::new(create_scaled_font(template, pt_size))); - self.paint_font_cache.push(PaintFontCacheEntry{ + self.paint_font_cache.push(PaintFontCacheEntry { font: paint_font.clone(), pt_size: pt_size, identifier: template.identifier.clone(), diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index f70d8a03cd3..afedee4c74f 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -751,11 +751,11 @@ impl<'a> PaintContext<'a> { border: &SideOffsets2D, radius: &BorderRadii, color: Color) { - let scaled_border = SideOffsets2D::new((1.0/3.0) * border.top, - (1.0/3.0) * border.right, - (1.0/3.0) * border.bottom, - (1.0/3.0) * border.left); - let inner_scaled_bounds = self.compute_scaled_bounds(bounds, border, 2.0/3.0); + let scaled_border = SideOffsets2D::new((1.0 / 3.0) * border.top, + (1.0 / 3.0) * border.right, + (1.0 / 3.0) * border.bottom, + (1.0 / 3.0) * border.left); + let inner_scaled_bounds = self.compute_scaled_bounds(bounds, border, 2.0 / 3.0); // draw the outer portion of the double border. self.draw_solid_border_segment(direction, bounds, &scaled_border, radius, color); // draw the inner portion of the double border. @@ -786,7 +786,7 @@ impl<'a> PaintContext<'a> { let lighter_color; let mut darker_color = color::black(); if color != darker_color { - darker_color = self.scale_color(color, if is_groove { 1.0/3.0 } else { 2.0/3.0 }); + darker_color = self.scale_color(color, if is_groove { 1.0 / 3.0 } else { 2.0 / 3.0 }); lighter_color = color; } else { // You can't scale black color (i.e. 'scaled = 0 * scale', equals black). @@ -832,10 +832,10 @@ impl<'a> PaintContext<'a> { if color != scaled_color { scaled_color = match direction { Direction::Top | Direction::Left => { - self.scale_color(color, if is_inset { 2.0/3.0 } else { 1.0 }) + self.scale_color(color, if is_inset { 2.0 / 3.0 } else { 1.0 }) } Direction::Right | Direction::Bottom => { - self.scale_color(color, if is_inset { 1.0 } else { 2.0/3.0 }) + self.scale_color(color, if is_inset { 1.0 } else { 2.0 / 3.0 }) } }; } else { diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 6e8b84ae4c5..37edd843ebb 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -659,12 +659,12 @@ enum MsgFromWorkerThread { } pub static THREAD_TINT_COLORS: [Color; 8] = [ - Color { r: 6.0/255.0, g: 153.0/255.0, b: 198.0/255.0, a: 0.7 }, - Color { r: 255.0/255.0, g: 212.0/255.0, b: 83.0/255.0, a: 0.7 }, - Color { r: 116.0/255.0, g: 29.0/255.0, b: 109.0/255.0, a: 0.7 }, - Color { r: 204.0/255.0, g: 158.0/255.0, b: 199.0/255.0, a: 0.7 }, - Color { r: 242.0/255.0, g: 46.0/255.0, b: 121.0/255.0, a: 0.7 }, - Color { r: 116.0/255.0, g: 203.0/255.0, b: 196.0/255.0, a: 0.7 }, - Color { r: 255.0/255.0, g: 249.0/255.0, b: 201.0/255.0, a: 0.7 }, - Color { r: 137.0/255.0, g: 196.0/255.0, b: 78.0/255.0, a: 0.7 }, + Color { r: 6.0 / 255.0, g: 153.0 / 255.0, b: 198.0 / 255.0, a: 0.7 }, + Color { r: 255.0 / 255.0, g: 212.0 / 255.0, b: 83.0 / 255.0, a: 0.7 }, + Color { r: 116.0 / 255.0, g: 29.0 / 255.0, b: 109.0 / 255.0, a: 0.7 }, + Color { r: 204.0 / 255.0, g: 158.0 / 255.0, b: 199.0 / 255.0, a: 0.7 }, + Color { r: 242.0 / 255.0, g: 46.0 / 255.0, b: 121.0 / 255.0, a: 0.7 }, + Color { r: 116.0 / 255.0, g: 203.0 / 255.0, b: 196.0 / 255.0, a: 0.7 }, + Color { r: 255.0 / 255.0, g: 249.0 / 255.0, b: 201.0 / 255.0, a: 0.7 }, + Color { r: 137.0 / 255.0, g: 196.0 / 255.0, b: 78.0 / 255.0, a: 0.7 }, ]; diff --git a/components/gfx/platform/freetype/font_list.rs b/components/gfx/platform/freetype/font_list.rs index 4084087fc54..48534016cac 100644 --- a/components/gfx/platform/freetype/font_list.rs +++ b/components/gfx/platform/freetype/font_list.rs @@ -8,17 +8,11 @@ extern crate freetype; extern crate fontconfig; use fontconfig::fontconfig::{FcChar8, FcResultMatch, FcSetSystem}; -use fontconfig::fontconfig::{ - FcConfigGetCurrent, FcConfigGetFonts, - FcConfigSubstitute, FcDefaultSubstitute, - FcFontMatch, - FcNameParse, FcPatternGetString, - FcPatternDestroy, FcFontSetDestroy, - FcMatchPattern, - FcPatternCreate, FcPatternAddString, - FcFontSetList, FcObjectSetCreate, FcObjectSetDestroy, - FcObjectSetAdd, FcPatternGetInteger -}; +use fontconfig::fontconfig::{FcConfigGetCurrent, FcConfigGetFonts, FcConfigSubstitute}; +use fontconfig::fontconfig::{FcDefaultSubstitute, FcFontMatch, FcNameParse, FcPatternGetString}; +use fontconfig::fontconfig::{FcPatternDestroy, FcFontSetDestroy, FcMatchPattern, FcPatternCreate}; +use fontconfig::fontconfig::{FcPatternAddString, FcFontSetList, FcObjectSetCreate, FcObjectSetDestroy}; +use fontconfig::fontconfig::{FcObjectSetAdd, FcPatternGetInteger}; use util::str::c_str_to_string; diff --git a/components/gfx/platform/macos/font_template.rs b/components/gfx/platform/macos/font_template.rs index 7e8229babe1..96be6a22f5f 100644 --- a/components/gfx/platform/macos/font_template.rs +++ b/components/gfx/platform/macos/font_template.rs @@ -89,7 +89,7 @@ impl Deserialize for CachedCTFont { type Value = CachedCTFont; #[inline] - fn visit_none(&mut self) -> Result where E: Error { + fn visit_none(&mut self) -> Result where E: Error { Ok(CachedCTFont(Mutex::new(None))) } } diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs index 75017144155..29918e5d2d9 100644 --- a/components/gfx/text/glyph.rs +++ b/components/gfx/text/glyph.rs @@ -394,7 +394,7 @@ impl<'a> DetailedGlyphStore { // Thar be dragons here. You have been warned. (Tips accepted.) let mut unsorted_records: Vec = vec!(); mem::swap(&mut self.detail_lookup, &mut unsorted_records); - let mut mut_records : Vec = unsorted_records; + let mut mut_records: Vec = unsorted_records; mut_records.sort_by(|a, b| { if a < b { Ordering::Less diff --git a/components/gfx/text/text_run.rs b/components/gfx/text/text_run.rs index dbdb913f25e..258766ac08e 100644 --- a/components/gfx/text/text_run.rs +++ b/components/gfx/text/text_run.rs @@ -46,7 +46,7 @@ pub struct NaturalWordSliceIterator<'a> { struct CharIndexComparator; -impl Comparator for CharIndexComparator { +impl Comparator for CharIndexComparator { fn compare(&self, key: &CharIndex, value: &GlyphRun) -> Ordering { if *key < value.range.begin() { Ordering::Less diff --git a/components/layout/animation.rs b/components/layout/animation.rs index f22865592c3..c9b78a50ef0 100644 --- a/components/layout/animation.rs +++ b/components/layout/animation.rs @@ -93,7 +93,7 @@ pub fn process_new_animations(rw_data: &mut LayoutTaskData, pipeline_id: Pipelin /// Recalculates style for a set of animations. This does *not* run with the DOM lock held. pub fn recalc_style_for_animations(flow: &mut Flow, - animations: &HashMap>) { + animations: &HashMap>) { let mut damage = RestyleDamage::empty(); flow.mutate_fragments(&mut |fragment| { if let Some(ref animations) = animations.get(&OpaqueNode(fragment.node.id())) { diff --git a/components/layout/context.rs b/components/layout/context.rs index 96fdc31beac..cfb58ccb3d4 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -124,7 +124,7 @@ pub struct SharedLayoutContext { pub visible_rects: Arc, DefaultState>>, /// The animations that are currently running. - pub running_animations: Arc>>, + pub running_animations: Arc>>, /// Why is this reflow occurring pub goal: ReflowGoal, diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index 1392fea7067..c5a2d86b249 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -139,7 +139,7 @@ impl<'a> Hash for ApplicableDeclarationsCacheQuery<'a> { static APPLICABLE_DECLARATIONS_CACHE_SIZE: usize = 32; pub struct ApplicableDeclarationsCache { - cache: SimpleHashCache>, + cache: SimpleHashCache>, } impl ApplicableDeclarationsCache { diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 06e6e004865..8710c519de0 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -45,10 +45,10 @@ use std::sync::Arc; use std::sync::mpsc::channel; use std::f32; use style::computed_values::filter::Filter; -use style::computed_values::{background_attachment, background_clip, background_origin, - background_repeat, background_size}; -use style::computed_values::{border_style, image_rendering, overflow_x, position, - visibility, transform, transform_style}; +use style::computed_values::{background_attachment, background_clip, background_origin}; +use style::computed_values::{background_repeat, background_size}; +use style::computed_values::{border_style, image_rendering, overflow_x, position}; +use style::computed_values::{visibility, transform, transform_style}; use style::properties::ComputedValues; use style::properties::style_structs::Border; use style::values::RGBA; @@ -1108,7 +1108,7 @@ impl FragmentDisplayListBuilding for Fragment { }, None => IpcSharedMemory::from_byte(0xFFu8, width * height * 4), }; - display_list.content.push_back(DisplayItem::ImageClass(box ImageDisplayItem{ + display_list.content.push_back(DisplayItem::ImageClass(box ImageDisplayItem { base: BaseDisplayItem::new(stacking_relative_content_box, DisplayItemMetadata::new(self.node, &*self.style, diff --git a/components/layout/flow.rs b/components/layout/flow.rs index d7dab549958..550fed85fad 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -468,10 +468,10 @@ pub trait MutableFlowUtils { // Traversals /// Traverses the tree in preorder. - fn traverse_preorder(self, traversal: &T); + fn traverse_preorder(self, traversal: &T); /// Traverses the tree in postorder. - fn traverse_postorder(self, traversal: &T); + fn traverse_postorder(self, traversal: &T); /// Traverse the Absolute flow tree in preorder. /// @@ -1301,7 +1301,7 @@ impl<'a> ImmutableFlowUtils for &'a (Flow + 'a) { impl<'a> MutableFlowUtils for &'a mut (Flow + 'a) { /// Traverses the tree in preorder. - fn traverse_preorder(self, traversal: &T) { + fn traverse_preorder(self, traversal: &T) { if traversal.should_process(self) { traversal.process(self); } @@ -1312,7 +1312,7 @@ impl<'a> MutableFlowUtils for &'a mut (Flow + 'a) { } /// Traverses the tree in postorder. - fn traverse_postorder(self, traversal: &T) { + fn traverse_postorder(self, traversal: &T) { for kid in child_iter(self) { kid.traverse_postorder(traversal); } @@ -1446,7 +1446,7 @@ impl OpaqueFlow { #[allow(unsafe_code)] pub fn from_flow(flow: &Flow) -> OpaqueFlow { unsafe { - let object = mem::transmute::<&Flow,raw::TraitObject>(flow); + let object = mem::transmute::<&Flow, raw::TraitObject>(flow); OpaqueFlow(object.data as usize) } } diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index a512db3670c..880e3b4ae4e 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -1446,7 +1446,7 @@ impl Fragment { /// A helper method that uses the breaking strategy described by `slice_iterator` (at present, /// either natural word breaking or character breaking) to split this fragment. - fn calculate_split_position_using_breaking_strategy<'a,I>( + fn calculate_split_position_using_breaking_strategy<'a, I>( &self, slice_iterator: I, max_inline_size: Au, diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs index 639fa1e3cc6..a761ff8fc0b 100644 --- a/components/layout/generated_content.rs +++ b/components/layout/generated_content.rs @@ -101,7 +101,7 @@ pub struct ResolveGeneratedContent<'a> { /// The counter representing an ordered list item. list_item: Counter, /// Named CSS counters. - counters: HashMap, + counters: HashMap, /// The level of quote nesting. quote: u32, } diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 89c71958289..fe1b19001af 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -309,11 +309,11 @@ impl LineBreaker { } /// Reflows the given fragments, which have been plucked out of the inline flow. - fn reflow_fragments<'a,I>(&mut self, - mut old_fragment_iter: I, - flow: &'a InlineFlow, - layout_context: &LayoutContext) - where I: Iterator { + fn reflow_fragments<'a, I>(&mut self, + mut old_fragment_iter: I, + flow: &'a InlineFlow, + layout_context: &LayoutContext) + where I: Iterator { loop { // Acquire the next fragment to lay out from the work list or fragment list, as // appropriate. diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 6028c8c3b6a..01f99285e9c 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -139,7 +139,7 @@ pub struct LayoutTaskData { pub offset_parent_response: OffsetParentResponse, /// The list of currently-running animations. - pub running_animations: Arc>>, + pub running_animations: Arc>>, /// Receives newly-discovered animations. pub new_animations_receiver: Receiver, @@ -708,7 +708,7 @@ impl LayoutTask { url: Url, mq: MediaQueryList, pending: PendingAsyncLoad, - responder: Box, + responder: Box, possibly_locked_rw_data: &mut Option>) { // TODO: Get the actual value. http://dev.w3.org/csswg/css-syntax/#environment-encoding diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index ad0517b6d1b..60d8c9de306 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -89,14 +89,14 @@ pub type UnsafeFlowList = (Box>, usize); pub type ChunkedDomTraversalFunction = extern "Rust" fn(UnsafeLayoutNodeList, - &mut WorkerProxy); + &mut WorkerProxy); pub type DomTraversalFunction = extern "Rust" fn(UnsafeLayoutNode, - &mut WorkerProxy); + &mut WorkerProxy); pub type ChunkedFlowTraversalFunction = - extern "Rust" fn(UnsafeFlowList, &mut WorkerProxy); + extern "Rust" fn(UnsafeFlowList, &mut WorkerProxy); pub type FlowTraversalFunction = extern "Rust" fn(UnsafeFlow, &SharedLayoutContext); @@ -104,13 +104,13 @@ pub type FlowTraversalFunction = extern "Rust" fn(UnsafeFlow, &SharedLayoutConte pub trait ParallelPreorderDomTraversal : PreorderDomTraversal { fn run_parallel(&self, nodes: UnsafeLayoutNodeList, - proxy: &mut WorkerProxy); + proxy: &mut WorkerProxy); #[inline(always)] fn run_parallel_helper( &self, unsafe_nodes: UnsafeLayoutNodeList, - proxy: &mut WorkerProxy, + proxy: &mut WorkerProxy, top_down_func: ChunkedDomTraversalFunction, bottom_up_func: DomTraversalFunction) { let mut discovered_child_nodes = Vec::new(); @@ -168,7 +168,7 @@ trait ParallelPostorderDomTraversal : PostorderDomTraversal { /// fetch-and-subtract the parent's children count. fn run_parallel(&self, mut unsafe_node: UnsafeLayoutNode, - proxy: &mut WorkerProxy) { + proxy: &mut WorkerProxy) { loop { // Get a real layout node. let node: LayoutNode = unsafe { @@ -284,14 +284,14 @@ trait ParallelPostorderFlowTraversal : PostorderFlowTraversal { trait ParallelPreorderFlowTraversal : PreorderFlowTraversal { fn run_parallel(&self, unsafe_flows: UnsafeFlowList, - proxy: &mut WorkerProxy); + proxy: &mut WorkerProxy); fn should_record_thread_ids(&self) -> bool; #[inline(always)] fn run_parallel_helper(&self, unsafe_flows: UnsafeFlowList, - proxy: &mut WorkerProxy, + proxy: &mut WorkerProxy, top_down_func: ChunkedFlowTraversalFunction, bottom_up_func: FlowTraversalFunction) { let mut discovered_child_flows = Vec::new(); @@ -335,7 +335,7 @@ trait ParallelPreorderFlowTraversal : PreorderFlowTraversal { impl<'a> ParallelPreorderFlowTraversal for AssignISizes<'a> { fn run_parallel(&self, unsafe_flows: UnsafeFlowList, - proxy: &mut WorkerProxy) { + proxy: &mut WorkerProxy) { self.run_parallel_helper(unsafe_flows, proxy, assign_inline_sizes, @@ -397,7 +397,7 @@ fn construct_flows(unsafe_node: UnsafeLayoutNode, } fn assign_inline_sizes(unsafe_flows: UnsafeFlowList, - proxy: &mut WorkerProxy) { + proxy: &mut WorkerProxy) { let shared_layout_context = proxy.user_data(); let layout_context = LayoutContext::new(shared_layout_context); let assign_inline_sizes_traversal = AssignISizes { @@ -438,12 +438,12 @@ fn build_display_list(unsafe_flow: UnsafeFlow, build_display_list_traversal.run_parallel(unsafe_flow); } -fn run_queue_with_custom_work_data_type( +fn run_queue_with_custom_work_data_type( queue: &mut WorkQueue, callback: F, shared_layout_context: &SharedLayoutContext) - where To: 'static + Send, F: FnOnce(&mut WorkQueue) { - let queue: &mut WorkQueue = unsafe { + where To: 'static + Send, F: FnOnce(&mut WorkQueue) { + let queue: &mut WorkQueue = unsafe { mem::transmute(queue) }; callback(queue); diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs index 6f806f69bf8..573d35a7b67 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -137,7 +137,7 @@ pub fn iterate_through_flow_tree_fragment_border_boxes(root: &mut FlowRef, }; // FIXME(#2795): Get the real container size. - doit(kid, level+1, iterator, &stacking_context_position); + doit(kid, level + 1, iterator, &stacking_context_position); } } diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index acd537c27f7..1d5d34d0e36 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -166,7 +166,7 @@ impl TableRowFlow { } } - pub fn populate_collapsed_border_spacing<'a,I>( + pub fn populate_collapsed_border_spacing<'a, I>( &mut self, collapsed_inline_direction_border_widths_for_table: &[Au], collapsed_block_direction_border_widths_for_table: &mut Peekable) diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs index 36ca99e0131..0b98a37c794 100644 --- a/components/layout/table_rowgroup.rs +++ b/components/layout/table_rowgroup.rs @@ -83,7 +83,7 @@ impl TableRowGroupFlow { &self.block_flow.fragment } - pub fn populate_collapsed_border_spacing<'a,I>( + pub fn populate_collapsed_border_spacing<'a, I>( &mut self, collapsed_inline_direction_border_widths_for_table: &[Au], collapsed_block_direction_border_widths_for_table: &mut Peekable) diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 82fe6df054a..a44db23a02d 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -280,7 +280,7 @@ impl<'ln> LayoutNode<'ln> { /// Borrows the layout data immutably. Fails on a conflicting borrow. #[inline(always)] - pub fn borrow_layout_data<'a>(&'a self) -> Ref<'a,Option> { + pub fn borrow_layout_data<'a>(&'a self) -> Ref<'a, Option> { unsafe { mem::transmute(self.get_jsmanaged().layout_data()) } @@ -288,7 +288,7 @@ impl<'ln> LayoutNode<'ln> { /// Borrows the layout data mutably. Fails on a conflicting borrow. #[inline(always)] - pub fn mutate_layout_data<'a>(&'a self) -> RefMut<'a,Option> { + pub fn mutate_layout_data<'a>(&'a self) -> RefMut<'a, Option> { unsafe { mem::transmute(self.get_jsmanaged().layout_data_mut()) } @@ -743,7 +743,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { /// /// TODO(pcwalton): Make this private. It will let us avoid borrow flag checks in some cases. #[inline(always)] - pub fn borrow_layout_data<'a>(&'a self) -> Ref<'a,Option> { + pub fn borrow_layout_data<'a>(&'a self) -> Ref<'a, Option> { self.node.borrow_layout_data() } @@ -751,7 +751,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { /// /// TODO(pcwalton): Make this private. It will let us avoid borrow flag checks in some cases. #[inline(always)] - pub fn mutate_layout_data<'a>(&'a self) -> RefMut<'a,Option> { + pub fn mutate_layout_data<'a>(&'a self) -> RefMut<'a, Option> { self.node.mutate_layout_data() } diff --git a/components/net/fetch/cors_cache.rs b/components/net/fetch/cors_cache.rs index 658beec6808..1be29e321b1 100644 --- a/components/net/fetch/cors_cache.rs +++ b/components/net/fetch/cors_cache.rs @@ -53,7 +53,7 @@ pub struct CORSCacheEntry { } impl CORSCacheEntry { - fn new(origin:Url, url: Url, max_age: u32, credentials: bool, + fn new(origin: Url, url: Url, max_age: u32, credentials: bool, header_or_method: HeaderOrMethod) -> CORSCacheEntry { CORSCacheEntry { origin: origin, diff --git a/components/net/fetch/request.rs b/components/net/fetch/request.rs index 7f689a28df0..150e01eec9e 100644 --- a/components/net/fetch/request.rs +++ b/components/net/fetch/request.rs @@ -112,7 +112,7 @@ pub struct Request { pub redirect_mode: RedirectMode, pub redirect_count: usize, pub response_tainting: ResponseTainting, - pub cache: Option> + pub cache: Option> } impl Request { diff --git a/components/net/mime_classifier.rs b/components/net/mime_classifier.rs index 3495d9a22ba..c4e94966548 100644 --- a/components/net/mime_classifier.rs +++ b/components/net/mime_classifier.rs @@ -23,14 +23,14 @@ impl MIMEClassifier { supplied_type: &Option<(String, String)>, data: &[u8]) -> Option<(String, String)> { - match *supplied_type{ + match *supplied_type { None => { return self.sniff_unknown_type(!no_sniff, data); } Some((ref media_type, ref media_subtype)) => { match (&**media_type, &**media_subtype) { ("unknown", "unknown") | ("application", "unknown") | ("*", "*") => { - return self.sniff_unknown_type(!no_sniff,data); + return self.sniff_unknown_type(!no_sniff, data); } _ => { if no_sniff { @@ -71,8 +71,8 @@ impl MIMEClassifier { return supplied_type.clone(); } - pub fn new()->MIMEClassifier { - MIMEClassifier{ + pub fn new() -> MIMEClassifier { + MIMEClassifier { image_classifier: GroupedClassifier::image_classifer(), audio_video_classifer: GroupedClassifier::audio_video_classifer(), scriptable_classifier: GroupedClassifier::scriptable_classifier(), @@ -84,7 +84,7 @@ impl MIMEClassifier { } //some sort of iterator over the classifiers might be better? fn sniff_unknown_type(&self, sniff_scriptable: bool, data: &[u8]) -> - Option<(String,String)> { + Option<(String, String)> { if sniff_scriptable { self.scriptable_classifier.classify(data) } else { @@ -107,21 +107,21 @@ impl MIMEClassifier { } } fn is_html(tp: &str, sub_tp: &str) -> bool { - tp=="text" && sub_tp=="html" + tp == "text" && sub_tp == "html" } } -pub fn as_string_option(tup: Option<(&'static str, &'static str)>) -> Option<(String,String)> { +pub fn as_string_option(tup: Option<(&'static str, &'static str)>) -> Option<(String, String)> { tup.map(|(a, b)| (a.to_owned(), b.to_owned())) } //Interface used for composite types trait MIMEChecker { - fn classify(&self, data: &[u8])->Option<(String, String)>; + fn classify(&self, data: &[u8]) -> Option<(String, String)>; } trait Matches { - fn matches(&mut self, matches: &[u8])->bool; + fn matches(&mut self, matches: &[u8]) -> bool; } impl <'a, T: Iterator + Clone> Matches for T { @@ -215,7 +215,7 @@ impl MIMEChecker for TagTerminatedByteMatcher { pub struct Mp4Matcher; impl Mp4Matcher { - pub fn matches(&self,data: &[u8]) -> bool { + pub fn matches(&self, data: &[u8]) -> bool { if data.len() < 12 { return false; } @@ -235,7 +235,7 @@ impl Mp4Matcher { } let mut all_match = true; for i in 8..11 { - if data[i]!=mp4[i - 8] { + if data[i] != mp4[i - 8] { all_match = false; break; } @@ -278,7 +278,7 @@ struct BinaryOrPlaintextClassifier; impl BinaryOrPlaintextClassifier { fn classify_impl(&self, data: &[u8]) -> Option<(&'static str, &'static str)> { - if (data.len() >=2 && + if (data.len() >= 2 && ((data[0] == 0xFFu8 && data[1] == 0xFEu8) || (data[0] == 0xFEu8 && data[1] == 0xFFu8))) || (data.len() >= 3 && data[0] == 0xEFu8 && data[1] == 0xBBu8 && data[2] == 0xBFu8) @@ -320,7 +320,7 @@ impl GroupedClassifier { } } fn audio_video_classifer() -> GroupedClassifier { - GroupedClassifier{ + GroupedClassifier { byte_matchers: vec![ box ByteMatcher::video_webm(), box ByteMatcher::audio_basic(), @@ -335,7 +335,7 @@ impl GroupedClassifier { } } fn scriptable_classifier() -> GroupedClassifier { - GroupedClassifier{ + GroupedClassifier { byte_matchers: vec![ box ByteMatcher::text_html_doctype(), box ByteMatcher::text_html_page(), @@ -361,7 +361,7 @@ impl GroupedClassifier { } fn plaintext_classifier() -> GroupedClassifier { - GroupedClassifier{ + GroupedClassifier { byte_matchers: vec![ box ByteMatcher::text_plain_utf_8_bom(), box ByteMatcher::text_plain_utf_16le_bom(), @@ -395,7 +395,7 @@ impl GroupedClassifier { } } impl MIMEChecker for GroupedClassifier { - fn classify(&self,data: &[u8]) -> Option<(String, String)> { + fn classify(&self, data: &[u8]) -> Option<(String, String)> { self.byte_matchers .iter() .filter_map(|matcher| matcher.classify(data)) @@ -405,7 +405,7 @@ impl MIMEChecker for GroupedClassifier { struct FeedsClassifier; impl FeedsClassifier { - fn classify_impl(&self,data: &[u8]) -> Option<(&'static str,&'static str)> { + fn classify_impl(&self, data: &[u8]) -> Option<(&'static str, &'static str)> { let length = data.len(); let mut data_iterator = data.iter(); @@ -469,7 +469,7 @@ impl FeedsClassifier { } impl MIMEChecker for FeedsClassifier { - fn classify(&self,data: &[u8]) -> Option<(String, String)> { + fn classify(&self, data: &[u8]) -> Option<(String, String)> { as_string_option(self.classify_impl(data)) } } @@ -478,8 +478,8 @@ impl MIMEChecker for FeedsClassifier { //TODO: These should be configured and not hard coded impl ByteMatcher { //A Windows Icon signature - fn image_x_icon()->ByteMatcher { - ByteMatcher{ + fn image_x_icon() -> ByteMatcher { + ByteMatcher { pattern: b"\x00\x00\x01\x00", mask: b"\xFF\xFF\xFF\xFF", content_type: ("image", "x-icon"), @@ -487,8 +487,8 @@ impl ByteMatcher { } } //A Windows Cursor signature. - fn image_x_icon_cursor()->ByteMatcher { - ByteMatcher{ + fn image_x_icon_cursor() -> ByteMatcher { + ByteMatcher { pattern: b"\x00\x00\x02\x00", mask: b"\xFF\xFF\xFF\xFF", content_type: ("image", "x-icon"), @@ -496,8 +496,8 @@ impl ByteMatcher { } } //The string "BM", a BMP signature. - fn image_bmp()->ByteMatcher { - ByteMatcher{ + fn image_bmp() -> ByteMatcher { + ByteMatcher { pattern: b"BM", mask: b"\xFF\xFF", content_type: ("image", "bmp"), @@ -505,8 +505,8 @@ impl ByteMatcher { } } //The string "GIF89a", a GIF signature. - fn image_gif89a()->ByteMatcher { - ByteMatcher{ + fn image_gif89a() -> ByteMatcher { + ByteMatcher { pattern: b"GIF89a", mask: b"\xFF\xFF\xFF\xFF\xFF\xFF", content_type: ("image", "gif"), @@ -514,8 +514,8 @@ impl ByteMatcher { } } //The string "GIF87a", a GIF signature. - fn image_gif87a()->ByteMatcher { - ByteMatcher{ + fn image_gif87a() -> ByteMatcher { + ByteMatcher { pattern: b"GIF87a", mask: b"\xFF\xFF\xFF\xFF\xFF\xFF", content_type: ("image", "gif"), @@ -523,8 +523,8 @@ impl ByteMatcher { } } //The string "RIFF" followed by four bytes followed by the string "WEBPVP". - fn image_webp()->ByteMatcher { - ByteMatcher{ + fn image_webp() -> ByteMatcher { + ByteMatcher { pattern: b"RIFF\x00\x00\x00\x00WEBPVP", mask: b"\xFF\xFF\xFF\xFF\x00\x00\x00\x00,\xFF\xFF\xFF\xFF\xFF\xFF", content_type: ("image", "webp"), @@ -533,8 +533,8 @@ impl ByteMatcher { } //An error-checking byte followed by the string "PNG" followed by CR LF SUB LF, the PNG //signature. - fn image_png()->ByteMatcher { - ByteMatcher{ + fn image_png() -> ByteMatcher { + ByteMatcher { pattern: b"\x89PNG\r\n\x1A\n", mask: b"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", content_type: ("image", "png"), @@ -542,8 +542,8 @@ impl ByteMatcher { } } // The JPEG Start of Image marker followed by the indicator byte of another marker. - fn image_jpeg()->ByteMatcher { - ByteMatcher{ + fn image_jpeg() -> ByteMatcher { + ByteMatcher { pattern: b"\xFF\xD8\xFF", mask: b"\xFF\xFF\xFF", content_type: ("image", "jpeg"), @@ -551,8 +551,8 @@ impl ByteMatcher { } } //The WebM signature. [TODO: Use more bytes?] - fn video_webm()->ByteMatcher { - ByteMatcher{ + fn video_webm() -> ByteMatcher { + ByteMatcher { pattern: b"\x1A\x45\xDF\xA3", mask: b"\xFF\xFF\xFF\xFF", content_type: ("video", "webm"), @@ -560,8 +560,8 @@ impl ByteMatcher { } } //The string ".snd", the basic audio signature. - fn audio_basic()->ByteMatcher { - ByteMatcher{ + fn audio_basic() -> ByteMatcher { + ByteMatcher { pattern: b".snd", mask: b"\xFF\xFF\xFF\xFF", content_type: ("audio", "basic"), @@ -569,8 +569,8 @@ impl ByteMatcher { } } //The string "FORM" followed by four bytes followed by the string "AIFF", the AIFF signature. - fn audio_aiff()->ByteMatcher { - ByteMatcher{ + fn audio_aiff() -> ByteMatcher { + ByteMatcher { pattern: b"FORM\x00\x00\x00\x00AIFF", mask: b"\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF", content_type: ("audio", "aiff"), @@ -578,8 +578,8 @@ impl ByteMatcher { } } //The string "ID3", the ID3v2-tagged MP3 signature. - fn audio_mpeg()->ByteMatcher { - ByteMatcher{ + fn audio_mpeg() -> ByteMatcher { + ByteMatcher { pattern: b"ID3", mask: b"\xFF\xFF\xFF", content_type: ("audio", "mpeg"), @@ -587,8 +587,8 @@ impl ByteMatcher { } } //The string "OggS" followed by NUL, the Ogg container signature. - fn application_ogg()->ByteMatcher { - ByteMatcher{ + fn application_ogg() -> ByteMatcher { + ByteMatcher { pattern: b"OggS", mask: b"\xFF\xFF\xFF\xFF\xFF", content_type: ("application", "ogg"), @@ -597,8 +597,8 @@ impl ByteMatcher { } //The string "MThd" followed by four bytes representing the number 6 in 32 bits (big-endian), //the MIDI signature. - fn audio_midi()->ByteMatcher { - ByteMatcher{ + fn audio_midi() -> ByteMatcher { + ByteMatcher { pattern: b"MThd\x00\x00\x00\x06", mask: b"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", content_type: ("audio", "midi"), @@ -606,8 +606,8 @@ impl ByteMatcher { } } //The string "RIFF" followed by four bytes followed by the string "AVI ", the AVI signature. - fn video_avi()->ByteMatcher { - ByteMatcher{ + fn video_avi() -> ByteMatcher { + ByteMatcher { pattern: b"RIFF\x00\x00\x00\x00AVI ", mask: b"\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF", content_type: ("video", "avi"), @@ -615,8 +615,8 @@ impl ByteMatcher { } } // The string "RIFF" followed by four bytes followed by the string "WAVE", the WAVE signature. - fn audio_wave()->ByteMatcher { - ByteMatcher{ + fn audio_wave() -> ByteMatcher { + ByteMatcher { pattern: b"RIFF\x00\x00\x00\x00WAVE", mask: b"\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF", content_type: ("audio", "wave"), @@ -624,9 +624,9 @@ impl ByteMatcher { } } // doctype terminated with Tag terminating (TT) Byte - fn text_html_doctype()->TagTerminatedByteMatcher { + fn text_html_doctype() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_page() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_head() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_script() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_iframe() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_h1() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_div() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_font() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_table() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_a() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_style() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_title() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_b() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_body() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_br() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_p() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"TagTerminatedByteMatcher { + fn text_html_comment() -> TagTerminatedByteMatcher { TagTerminatedByteMatcher { - matcher: ByteMatcher{ + matcher: ByteMatcher { pattern: b"