From 7e460af14fc49dff5ad18869af0d251884fe5e0f Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Thu, 7 Feb 2019 13:39:41 -0800 Subject: [PATCH] futures: Make `WithSubscriber` work with existing `Dispatch` The upstream change that made `Dispatch` no longer implement `Subscriber` broke this a bit, since a `Dispatch` can no longer be passed to `with_subscriber`. To make this also work with unwrapped subscribers, we'll probably want an impl of `From` for `Dispatch`. Signed-off-by: Eliza Weisman --- tokio-trace-futures/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio-trace-futures/src/lib.rs b/tokio-trace-futures/src/lib.rs index 1584e55540..e244097297 100644 --- a/tokio-trace-futures/src/lib.rs +++ b/tokio-trace-futures/src/lib.rs @@ -21,11 +21,11 @@ pub trait Instrument: Sized { pub trait WithSubscriber: Sized { fn with_subscriber(self, subscriber: S) -> WithDispatch where - S: Subscriber + Send + Sync + 'static, + S: Into, { WithDispatch { inner: self, - dispatch: Dispatch::new(subscriber), + dispatch: subscriber.into(), } } }