Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Lok <[email protected]>
  • Loading branch information
andylokandy committed Feb 7, 2024
1 parent 6f684e7 commit d8cade9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions minitrace-futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,22 @@ pub trait StreamExt: futures::Stream + Sized {
/// use async_stream::stream;
/// use futures::StreamExt;
/// use minitrace::prelude::*;
/// use minitrace_futures::*;
/// use minitrace_futures::StreamExt as _;
///
/// let root = Span::root("Root", SpanContext::random());
/// let root = Span::root("root", SpanContext::random());
/// let s = stream! {
/// for i in 0..2 {
/// yield i;
/// }
/// }
/// .in_span(Span::enter_with_parent("Task", &root));
/// .in_span(Span::enter_with_parent("task", &root));
///
/// tokio::pin!(s);
///
/// assert_eq!(s.next().await.unwrap(), 0);
/// assert_eq!(s.next().await.unwrap(), 1);
/// assert_eq!(s.next().await, None);
/// // span ends here.
///
/// # }
/// ```
fn in_span(self, span: Span) -> InSpan<Self> {
Expand Down Expand Up @@ -72,17 +71,16 @@ pub trait SinkExt<Item>: futures::Sink<Item> + Sized {
/// use futures::sink;
/// use futures::sink::SinkExt;
/// use minitrace::prelude::*;
/// use minitrace_futures::*;
/// use minitrace_futures::SinkExt as _;
///
/// let root = Span::root("Root", SpanContext::random());
/// let root = Span::root("root", SpanContext::random());
///
/// let mut drain = sink::drain().in_span(Span::enter_with_parent("Task", &root));
/// let mut drain = sink::drain().in_span(Span::enter_with_parent("task", &root));
///
/// drain.send(1).await.unwrap();
/// drain.send(2).await.unwrap();
/// drain.close().await.unwrap();
/// // span ends here.
///
/// # }
/// ```
fn in_span(self, span: Span) -> InSpan<Self> {
Expand Down

0 comments on commit d8cade9

Please sign in to comment.