diff options
author | Douman <douman@gmx.se> | 2019-08-15 22:00:57 +0200 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2019-08-15 13:00:57 -0700 |
commit | 37131b21144de133628b54a1de500b623058f8cf (patch) | |
tree | f0307a4f142957b1e64f21e30e788935f9af9fcd /tokio-test/src | |
parent | 8538c25170240fa46313ffe9d4a9a2f9ba2536e5 (diff) |
runtime: refactor thread-local setters (#1449)
Diffstat (limited to 'tokio-test/src')
-rw-r--r-- | tokio-test/src/clock.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tokio-test/src/clock.rs b/tokio-test/src/clock.rs index 942d9b6f..43f073d9 100644 --- a/tokio-test/src/clock.rs +++ b/tokio-test/src/clock.rs @@ -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() }) } } |