Separate the async bluetooth handling from networking code.

They're not at all related, besides both being asynchronous. This change adds
a little extra code in response_async(), but makes this code more readable
and reduces the unnecessary indirection.

This change also makes the build system slightly more parallel, by dropping
the dependency on bluetooth_traits from net_traits.
This commit is contained in:
Ms2ger 2016-12-21 14:39:10 +01:00
parent c2e4e4295e
commit 7af7a10e7e
6 changed files with 25 additions and 34 deletions

View file

@ -9,7 +9,6 @@
#![deny(unsafe_code)]
extern crate bluetooth_traits;
extern crate cookie as cookie_rs;
extern crate heapsize;
#[macro_use] extern crate heapsize_derive;
@ -34,7 +33,6 @@ extern crate uuid;
extern crate webrender_traits;
extern crate websocket;
use bluetooth_traits::{BluetoothResponseListener, BluetoothResponseResult};
use cookie_rs::Cookie;
use filemanager_thread::FileManagerThreadMsg;
use heapsize::HeapSizeOf;
@ -238,13 +236,6 @@ impl<T: FetchResponseListener> Action<T> for FetchResponseMsg {
}
}
impl<T: BluetoothResponseListener> Action<T> for BluetoothResponseResult {
/// Execute the default action on a provided listener.
fn process(self, listener: &mut T) {
listener.response(self)
}
}
/// Handle to a resource thread
pub type CoreResourceThread = IpcSender<CoreResourceMsg>;