aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2015-07-24 22:16:35 +0200
committerSimon Sapin <simon.sapin@exyr.org>2015-07-24 22:16:35 +0200
commita3c0366bd62bc4ac9a52b3e45bf81ba5fea4ed1a (patch)
treeb57a73146ff54aa8ac718baf4cbe253c6bb6d8a9
parent903a608c6aa19343bbf5487ae6144fe844184f46 (diff)
downloadservo-a3c0366bd62bc4ac9a52b3e45bf81ba5fea4ed1a.tar.gz
servo-a3c0366bd62bc4ac9a52b3e45bf81ba5fea4ed1a.zip
Fix deprecation warnings
-rw-r--r--components/profile/lib.rs2
-rw-r--r--components/profile/mem.rs11
-rw-r--r--components/script/dom/document.rs2
-rw-r--r--components/script/dom/htmloptionelement.rs2
-rw-r--r--components/script/script_task.rs2
-rw-r--r--components/util/lib.rs2
-rw-r--r--components/util/opts.rs9
7 files changed, 15 insertions, 15 deletions
diff --git a/components/profile/lib.rs b/components/profile/lib.rs
index a874ed233bb..08971cb3e0f 100644
--- a/components/profile/lib.rs
+++ b/components/profile/lib.rs
@@ -5,7 +5,7 @@
#![feature(box_syntax)]
#![feature(iter_arith)]
#![cfg_attr(target_os="linux", feature(page_size))]
-#![feature(slice_extras)]
+#![feature(slice_splits)]
#[macro_use] extern crate log;
diff --git a/components/profile/mem.rs b/components/profile/mem.rs
index 00a5c51f14b..ff9a19ecc36 100644
--- a/components/profile/mem.rs
+++ b/components/profile/mem.rs
@@ -249,14 +249,15 @@ impl ReportsForest {
// Insert the path and size into the forest, adding any trees and nodes as necessary.
fn insert(&mut self, path: &[String], size: usize) {
+ let (head, tail) = path.split_first().unwrap();
// Get the right tree, creating it if necessary.
- if !self.trees.contains_key(&path[0]) {
- self.trees.insert(path[0].clone(), ReportsTree::new(path[0].clone()));
+ if !self.trees.contains_key(head) {
+ self.trees.insert(head.clone(), ReportsTree::new(head.clone()));
}
- let t = self.trees.get_mut(&path[0]).unwrap();
+ let t = self.trees.get_mut(head).unwrap();
- // Use tail() because the 0th path segment was used to find the right tree in the forest.
- t.insert(path.tail(), size);
+ // Use tail because the 0th path segment was used to find the right tree in the forest.
+ t.insert(tail, size);
}
fn print(&mut self) {
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index d074dca0d4e..bd9e0fcfb92 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -1432,7 +1432,7 @@ impl<'a> DocumentMethods for &'a Document {
Some(ref title) => {
// Steps 3-4.
let value = Node::collect_text_contents(title.r().children());
- split_html_space_chars(&value).collect::<Vec<_>>().connect(" ")
+ split_html_space_chars(&value).collect::<Vec<_>>().join(" ")
},
}
}
diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs
index b675f30ac03..28b7f0651ae 100644
--- a/components/script/dom/htmloptionelement.rs
+++ b/components/script/dom/htmloptionelement.rs
@@ -88,7 +88,7 @@ impl<'a> HTMLOptionElementMethods for &'a HTMLOptionElement {
let mut content = String::new();
collect_text(&node, &mut content);
let v: Vec<&str> = split_html_space_chars(&content).collect();
- v.connect(" ")
+ v.join(" ")
}
// https://www.whatwg.org/html/#dom-option-text
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 480514b36b2..f48f7a53b3a 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -1060,7 +1060,7 @@ impl ScriptTask {
for it_page in self.root_page().iter() {
urls.push(it_page.document().url().serialize());
}
- let path_seg = format!("url({})", urls.connect(", "));
+ let path_seg = format!("url({})", urls.join(", "));
let reports = ScriptTask::get_reports(self.get_cx(), path_seg);
reports_chan.send(reports);
}
diff --git a/components/util/lib.rs b/components/util/lib.rs
index 4e7759795c9..b108c516acc 100644
--- a/components/util/lib.rs
+++ b/components/util/lib.rs
@@ -15,7 +15,7 @@
#![feature(path_ext)]
#![feature(plugin)]
#![feature(rustc_private)]
-#![feature(slice_extras)]
+#![feature(slice_splits)]
#![feature(step_by)]
#![feature(step_trait)]
#![feature(zero_one)]
diff --git a/components/util/opts.rs b/components/util/opts.rs
index 6787c9e7492..c8f65c97e54 100644
--- a/components/util/opts.rs
+++ b/components/util/opts.rs
@@ -267,8 +267,7 @@ pub fn default_opts() -> Opts {
}
pub fn from_cmdline_args(args: &[String]) {
- let app_name = args[0].to_string();
- let args = args.tail();
+ let (app_name, args) = args.split_first().unwrap();
let opts = vec!(
getopts::optflag("c", "cpu", "CPU painting (default)"),
@@ -305,7 +304,7 @@ pub fn from_cmdline_args(args: &[String]) {
};
if opt_match.opt_present("h") || opt_match.opt_present("help") {
- print_usage(&app_name, &opts);
+ print_usage(app_name, &opts);
process::exit(0);
};
@@ -318,11 +317,11 @@ pub fn from_cmdline_args(args: &[String]) {
debug_options.insert(split.clone());
}
if debug_options.contains(&"help") {
- print_debug_usage(&app_name)
+ print_debug_usage(app_name)
}
let url = if opt_match.free.is_empty() {
- print_usage(&app_name, &opts);
+ print_usage(app_name, &opts);
args_fail("servo asks that you provide a URL")
} else {
let ref url = opt_match.free[0];