This fixes a Clippy lint for explicitly calling `drop` on a value without a `Drop` impl, and a lint for `let` bindings whose value is `()`. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
25 lines
683 B
Rust
25 lines
683 B
Rust
#![cfg(feature = "registry")]
|
|
use tracing_futures::{Instrument, WithCollector};
|
|
use tracing_subscriber::prelude::*;
|
|
|
|
#[tokio::test]
|
|
async fn future_with_subscriber() {
|
|
tracing_subscriber::registry().init();
|
|
let span = tracing::info_span!("foo");
|
|
let _e = span.enter();
|
|
let span = tracing::info_span!("bar");
|
|
let _e = span.enter();
|
|
tokio::spawn(
|
|
async {
|
|
async {
|
|
let span = tracing::Span::current();
|
|
println!("{:?}", span);
|
|
}
|
|
.instrument(tracing::info_span!("hi"))
|
|
.await
|
|
}
|
|
.with_collector(tracing_subscriber::registry()),
|
|
)
|
|
.await
|
|
.unwrap();
|
|
}
|