mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Fix some warnings in servo/lib.rs.
This commit is contained in:
parent
7896679afe
commit
31f6595981
1 changed files with 6 additions and 7 deletions
|
@ -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<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"),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue