Commit b2b310fe authored by Ralf's avatar Ralf
Browse files

cargo fmt

parent e76cfc7c
......@@ -10,4 +10,3 @@ pub enum Event {
Buzz,
UserCommand,
}
......@@ -18,13 +18,12 @@ struct ThreadState {
}
pub trait SpawnWakeable<'a> {
fn spawn_wakeable<F>(&self, f: F) where
F: FnOnce(WakeableThread) + Send + 'a;
fn spawn_wakeable<F>(&self, f: F) where F: FnOnce(WakeableThread) + Send + 'a;
}
impl<'a> SpawnWakeable<'a> for Scope<'a> {
fn spawn_wakeable<F>(&self, f: F) where
F: FnOnce(WakeableThread) + Send + 'a
fn spawn_wakeable<F>(&self, f: F)
where F: FnOnce(WakeableThread) + Send + 'a
{
let state = Arc::new(ThreadState {
mutex: Mutex::new(ShouldThreadRun::Yes),
......@@ -32,7 +31,7 @@ impl<'a> SpawnWakeable<'a> for Scope<'a> {
});
let thread = WakeableThread { state: state.clone() };
self.spawn(move || f(thread) );
self.spawn(move || f(thread));
// Now defer the action that we want to wake up this thread.
// This will be executed *before* the join deferred by spawn.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment