mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
opts.rs: don't accept multiple URLs. Fixes #5520.
Switched from opts.urls from being of type Vec to type String and changing the name to `url` as well. Changed the other files that are using opts.urls accordingly. servo/lib.rs + gonk/src/lib.rs: no need for a block scope. cef: fix compiler errors. - remove the use of `mut` since it's not needed. - use `to_owned` instead of `to_string` because it's more efficient.
This commit is contained in:
parent
c070ad6196
commit
74cd4cd56a
5 changed files with 28 additions and 38 deletions
|
@ -114,23 +114,20 @@ impl Browser {
|
|||
|
||||
// Send the URL command to the constellation.
|
||||
let cwd = env::current_dir().unwrap();
|
||||
for url in opts.urls.iter() {
|
||||
let url = match url::Url::parse(&*url) {
|
||||
Ok(url) => url,
|
||||
Err(url::ParseError::RelativeUrlWithoutBase)
|
||||
=> url::Url::from_file_path(&*cwd.join(&*url)).unwrap(),
|
||||
Err(_) => panic!("URL parsing failed"),
|
||||
};
|
||||
let url = match url::Url::parse(&opts.url) {
|
||||
Ok(url) => url,
|
||||
Err(url::ParseError::RelativeUrlWithoutBase)
|
||||
=> url::Url::from_file_path(&*cwd.join(&opts.url)).unwrap(),
|
||||
Err(_) => panic!("URL parsing failed"),
|
||||
};
|
||||
|
||||
let ConstellationChan(ref chan) = constellation_chan;
|
||||
chan.send(ConstellationMsg::InitLoadUrl(url)).unwrap();
|
||||
}
|
||||
let ConstellationChan(ref chan) = constellation_chan;
|
||||
chan.send(ConstellationMsg::InitLoadUrl(url)).unwrap();
|
||||
|
||||
debug!("preparing to enter main loop");
|
||||
let compositor = CompositorTask::create(window,
|
||||
compositor_proxy,
|
||||
compositor_receiver,
|
||||
constellation_chan,
|
||||
constellation_chan.clone(),
|
||||
time_profiler_chan,
|
||||
mem_profiler_chan);
|
||||
|
||||
|
@ -159,4 +156,3 @@ impl Browser {
|
|||
self.compositor.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue