Skip to content

Commit

Permalink
futures: Make WithSubscriber work with existing Dispatch
Browse files Browse the repository at this point in the history
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<Subscriber>` for `Dispatch`.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw committed Feb 7, 2019
1 parent ded0e20 commit 7e460af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tokio-trace-futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ pub trait Instrument: Sized {
pub trait WithSubscriber: Sized {
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where
S: Subscriber + Send + Sync + 'static,
S: Into<Dispatch>,
{
WithDispatch {
inner: self,
dispatch: Dispatch::new(subscriber),
dispatch: subscriber.into(),
}
}
}
Expand Down

0 comments on commit 7e460af

Please sign in to comment.