зеркало из https://github.com/mozilla/gecko-dev.git
webdriver: Return early using try!() instead of unwrapping errors (#43)
* server: return early using try!() instead of unwrapping errors Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 8d22698d409c62d74963a70461a886b7a16cdc1a committer: jgraham <james@hoppipolla.co.uk> --HG-- extra : subtree_source : http%3A//tristan.corp.lon2.mozilla.com%3A8000 extra : subtree_revision : ab9c385db54ca55aca09902dc5cf6798c148e720
This commit is contained in:
Родитель
8a47f8db3f
Коммит
7f2b15f489
|
@ -241,15 +241,14 @@ pub fn start<T, U>(address: SocketAddr,
|
|||
|
||||
let api = WebDriverHttpApi::new(extension_routes);
|
||||
let http_handler = HttpHandler::new(api, msg_send);
|
||||
let mut server = Server::http(address).unwrap();
|
||||
let mut server = try!(Server::http(address));
|
||||
server.keep_alive(None);
|
||||
|
||||
let builder = thread::Builder::new().name("webdriver dispatcher".to_string());
|
||||
builder.spawn(move || {
|
||||
let mut dispatcher = Dispatcher::new(handler);
|
||||
dispatcher.run(msg_recv);
|
||||
})
|
||||
.unwrap();
|
||||
try!(builder.spawn(move || {
|
||||
let mut dispatcher = Dispatcher::new(handler);
|
||||
dispatcher.run(msg_recv);
|
||||
}));
|
||||
|
||||
server.handle(http_handler)
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче