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 8, 2019
1 parent 08c5dd1 commit 75c0b00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tokio-trace-futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern crate tokio;
extern crate tokio_trace;

use futures::{Async, Future, Poll, Sink, StartSend, Stream};
use tokio_trace::{dispatcher, Dispatch, Span, Subscriber};
use tokio_trace::{dispatcher, Dispatch, Span};

pub mod executor;

Expand All @@ -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 75c0b00

Please sign in to comment.