diff options
-rw-r--r-- | components/servo/lib.rs | 13 |
1 files 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; @@ -52,8 +51,6 @@ use util::opts; use util::taskpool::TaskPool; #[cfg(not(test))] -use std::os; -#[cfg(not(test))] use std::rc::Rc; #[cfg(not(test))] use std::sync::mpsc::channel; @@ -67,6 +64,8 @@ pub struct Browser<Window> { impl<Window> Browser<Window> where Window: WindowMethods + 'static { #[cfg(not(test))] pub fn new(window: Option<Rc<Window>>) -> Browser<Window> { + use std::env; + ::util::opts::set_experimental_enabled(opts::get().enable_experimental); let opts = opts::get(); RegisterBindings::RegisterProxyHandlers(); @@ -112,12 +111,12 @@ impl<Window> Browser<Window> 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"), }; |