runtime: refactor thread-local setters (#1449)

This commit is contained in:
Douman
2019-08-15 13:00:57 -07:00
committed by Carl Lerche
parent 8538c25170
commit 37131b2114
10 changed files with 97 additions and 120 deletions
+4 -5
View File
@@ -134,11 +134,10 @@ impl MockClock {
let handle = timer.handle();
let time = self.time.clone();
::tokio_timer::with_default(&handle, || {
let mut handle = Handle::new(timer, time);
f(&mut handle)
// lazy(|| Ok::<_, ()>(f(&mut handle))).wait().unwrap()
})
let _timer = ::tokio_timer::set_default(&handle);
let mut handle = Handle::new(timer, time);
f(&mut handle)
// lazy(|| Ok::<_, ()>(f(&mut handle))).wait().unwrap()
})
}
}