From 31f65959818751ab0dadc18acb5a90357067c9a4 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 12 Feb 2015 18:39:14 +0100 Subject: [PATCH] Fix some warnings in servo/lib.rs. --- components/servo/lib.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 005514b5757..903beab52f3 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -2,10 +2,9 @@ * 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(thread_local)] +#![feature(core, env, libc, path, rustc_private, std_misc, thread_local)] #![allow(missing_copy_implementations)] -#![allow(unstable)] #[macro_use] extern crate log; @@ -51,8 +50,6 @@ use util::opts; #[cfg(not(test))] use util::taskpool::TaskPool; -#[cfg(not(test))] -use std::os; #[cfg(not(test))] use std::rc::Rc; #[cfg(not(test))] @@ -67,6 +64,8 @@ pub struct Browser { impl Browser where Window: WindowMethods + 'static { #[cfg(not(test))] pub fn new(window: Option>) -> Browser { + use std::env; + ::util::opts::set_experimental_enabled(opts::get().enable_experimental); let opts = opts::get(); RegisterBindings::RegisterProxyHandlers(); @@ -112,12 +111,12 @@ impl Browser where Window: WindowMethods + 'static { storage_task); // Send the URL command to the constellation. - let cwd = os::getcwd().unwrap(); + let cwd = env::current_dir().unwrap(); for url in opts.urls.iter() { - let url = match url::Url::parse(url.as_slice()) { + let url = match url::Url::parse(&*url) { Ok(url) => url, Err(url::ParseError::RelativeUrlWithoutBase) - => url::Url::from_file_path(&cwd.join(url.as_slice())).unwrap(), + => url::Url::from_file_path(&cwd.join(&*url)).unwrap(), Err(_) => panic!("URL parsing failed"), };