mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
Fix deprecation warnings
This commit is contained in:
parent
903a608c6a
commit
a3c0366bd6
7 changed files with 15 additions and 15 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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(" ")
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue