Remove usage of unstable box syntax, except in the script crate

… because there’s a lot of it,
and script still uses any other unstable features anyway.
This commit is contained in:
Simon Sapin 2017-10-11 23:12:43 +02:00
parent 796a8dc618
commit aa5761a5fb
40 changed files with 195 additions and 195 deletions

View file

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![deny(unsafe_code)]
#![feature(box_syntax)]
#![feature(conservative_impl_trait)]
#![feature(mpsc_select)]

View file

@ -68,14 +68,14 @@ impl NetworkListener {
}
};
ROUTER.add_route(ipc_receiver.to_opaque(), box move |message| {
ROUTER.add_route(ipc_receiver.to_opaque(), Box::new(move |message| {
let msg = message.to();
match msg {
Ok(FetchResponseMsg::ProcessResponse(res)) => listener.check_redirect(res),
Ok(msg_) => listener.send(msg_),
Err(e) => warn!("Error while receiving network listener message: {}", e),
};
});
}));
if let Err(e) = self.resource_threads.sender().send(msg) {
warn!("Resource thread unavailable ({})", e);

View file

@ -232,14 +232,14 @@ impl Pipeline {
let (script_to_devtools_chan, script_to_devtools_port) = ipc::channel()
.expect("Pipeline script to devtools chan");
let devtools_chan = (*devtools_chan).clone();
ROUTER.add_route(script_to_devtools_port.to_opaque(), box move |message| {
ROUTER.add_route(script_to_devtools_port.to_opaque(), Box::new(move |message| {
match message.to::<ScriptToDevtoolsControlMsg>() {
Err(e) => error!("Cast to ScriptToDevtoolsControlMsg failed ({}).", e),
Ok(message) => if let Err(e) = devtools_chan.send(DevtoolsControlMsg::FromScript(message)) {
warn!("Sending to devtools failed ({})", e)
},
}
});
}));
script_to_devtools_chan
});