Reformat fetch_async().

This commit is contained in:
Ms2ger 2017-01-03 14:55:31 +01:00
parent 410e5c6d6f
commit 22f85bfed6

View file

@ -379,9 +379,8 @@ pub fn fetch_async<F>(request: RequestInit,
where F: Fn(FetchResponseMsg) + Send + 'static where F: Fn(FetchResponseMsg) + Send + 'static
{ {
let (action_sender, action_receiver) = ipc::channel().unwrap(); let (action_sender, action_receiver) = ipc::channel().unwrap();
ROUTER.add_route(action_receiver.to_opaque(), box move |message| { ROUTER.add_route(action_receiver.to_opaque(),
f(message.to().unwrap()); box move |message| f(message.to().unwrap()));
});
core_resource_thread.send(CoreResourceMsg::Fetch(request, action_sender)).unwrap(); core_resource_thread.send(CoreResourceMsg::Fetch(request, action_sender)).unwrap();
} }