From 7df8dc61774c0f3eba5902632bc2e056d6a536e7 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Fri, 11 Dec 2015 09:58:43 -0500 Subject: [PATCH 1/5] Fix warning: unused_imports in constellation_msg.rs. --- components/msg/constellation_msg.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 7a77b78774a..0469fd95672 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -6,7 +6,7 @@ //! reduce coupling between these two components. use euclid::scale_factor::ScaleFactor; -use euclid::size::{Size2D, TypedSize2D}; +use euclid::size::TypedSize2D; use hyper::header::Headers; use hyper::method::Method; use ipc_channel::ipc::{self, IpcReceiver, IpcSender, IpcSharedMemory}; From bccb46c70a49104dabf3bb47aaefc731a5658388 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Fri, 11 Dec 2015 10:03:45 -0500 Subject: [PATCH 2/5] Fix warning: needless 'iter_cmp' flags --- components/compositing/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index ea2e1f5d92a..acc8f04c664 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -4,7 +4,6 @@ #![feature(box_syntax)] #![feature(custom_derive)] -#![feature(iter_cmp)] #![feature(plugin)] #![feature(slice_bytes)] #![feature(mpsc_select)] From 7267163f4915ee61c0e34e0b54eaa1c4fa7ff3b2 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Fri, 11 Dec 2015 10:18:01 -0500 Subject: [PATCH 3/5] Fix warnings: use clone_from_slice instead of copy_memory --- components/canvas/lib.rs | 1 + components/canvas/webgl_paint_task.rs | 3 +-- components/compositing/compositor.rs | 4 +--- components/compositing/lib.rs | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/components/canvas/lib.rs b/components/canvas/lib.rs index cf865c2f163..d7ff9c30b04 100644 --- a/components/canvas/lib.rs +++ b/components/canvas/lib.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#![feature(clone_from_slice)] #![feature(nonzero)] #![feature(slice_bytes)] #![feature(plugin)] diff --git a/components/canvas/webgl_paint_task.rs b/components/canvas/webgl_paint_task.rs index f5cd8a87fab..6a79c967f26 100644 --- a/components/canvas/webgl_paint_task.rs +++ b/components/canvas/webgl_paint_task.rs @@ -13,7 +13,6 @@ use ipc_channel::router::ROUTER; use layers::platform::surface::NativeSurface; use offscreen_gl_context::{ColorAttachmentType, GLContext, GLContextAttributes}; use std::borrow::ToOwned; -use std::slice::bytes::copy_memory; use std::sync::mpsc::{Sender, channel}; use util::task::spawn_named; use util::vec::byte_swap; @@ -365,7 +364,7 @@ impl WebGLPaintTask { let dst_start = y * stride; let src_start = (height - y - 1) * stride; let src_slice = &orig_pixels[src_start .. src_start + stride]; - copy_memory(&src_slice[..stride], &mut pixels[dst_start .. dst_start + stride]); + (&mut pixels[dst_start .. dst_start + stride]).clone_from_slice(&src_slice[..stride]); } // rgba -> bgra diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 417f9072974..9548457039d 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -44,7 +44,6 @@ use std::collections::{HashMap, HashSet}; use std::fs::File; use std::mem as std_mem; use std::rc::Rc; -use std::slice::bytes::copy_memory; use std::sync::mpsc::Sender; use style_traits::viewport::ViewportConstraints; use surface_map::SurfaceMap; @@ -1913,8 +1912,7 @@ impl IOCompositor { let dst_start = y * stride; let src_start = (height - y - 1) * stride; let src_slice = &orig_pixels[src_start .. src_start + stride]; - copy_memory(&src_slice[..stride], - &mut pixels[dst_start .. dst_start + stride]); + (&mut pixels[dst_start .. dst_start + stride]).clone_from_slice(&src_slice[..stride]); } RgbImage::from_raw(width as u32, height as u32, pixels).unwrap() } diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index acc8f04c664..6bab532cc36 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #![feature(box_syntax)] +#![feature(clone_from_slice)] #![feature(custom_derive)] #![feature(plugin)] #![feature(slice_bytes)] From 196f15b69658d07abdeff5d15449ef2677159500 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Fri, 11 Dec 2015 10:21:23 -0500 Subject: [PATCH 4/5] Fix warnings: Remove unused 'slice_bytes' flag --- components/canvas/lib.rs | 1 - components/compositing/lib.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/components/canvas/lib.rs b/components/canvas/lib.rs index d7ff9c30b04..87b61010278 100644 --- a/components/canvas/lib.rs +++ b/components/canvas/lib.rs @@ -4,7 +4,6 @@ #![feature(clone_from_slice)] #![feature(nonzero)] -#![feature(slice_bytes)] #![feature(plugin)] #![plugin(plugins)] diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index 6bab532cc36..338a802d627 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -6,7 +6,6 @@ #![feature(clone_from_slice)] #![feature(custom_derive)] #![feature(plugin)] -#![feature(slice_bytes)] #![feature(mpsc_select)] #![feature(plugin)] #![plugin(plugins)] From 4906b38af97f4751e8a0e5425c1fbd8ed40ce953 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Fri, 11 Dec 2015 10:39:23 -0500 Subject: [PATCH 5/5] Fix warning: Stop to use deprecated 'SocketAddr::new' --- components/webdriver_server/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index a96f7db3cb4..b462d033148 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -5,7 +5,7 @@ #![crate_name = "webdriver_server"] #![crate_type = "rlib"] -#![feature(ip_addr, plugin)] +#![feature(plugin)] #![plugin(plugins)] extern crate compositing; @@ -37,7 +37,7 @@ use rustc_serialize::base64::{CharacterSet, Config, Newline, ToBase64}; use rustc_serialize::json::{Json, ToJson}; use std::borrow::ToOwned; use std::collections::BTreeMap; -use std::net::SocketAddr; +use std::net::{SocketAddr, SocketAddrV4}; use std::sync::mpsc::Sender; use std::thread; use std::time::Duration; @@ -63,7 +63,8 @@ fn extension_routes() -> Vec<(Method, &'static str, ServoExtensionRoute)> { pub fn start_server(port: u16, constellation_chan: Sender) { let handler = Handler::new(constellation_chan); spawn_named("WebdriverHttpServer".to_owned(), move || { - server::start(SocketAddr::new("0.0.0.0".parse().unwrap(), port), handler, + let address = SocketAddrV4::new("0.0.0.0".parse().unwrap(), port); + server::start(SocketAddr::V4(address), handler, extension_routes()); }); }