mirror of
				https://github.com/tokio-rs/tracing.git
				synced 2025-11-04 07:23:02 +00:00 
			
		
		
		
	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>
		
			
				
	
	
		
			26 lines
		
	
	
		
			685 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			685 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
#![cfg(feature = "registry")]
 | 
						|
use tracing_futures::{Instrument, WithSubscriber};
 | 
						|
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_subscriber(tracing_subscriber::registry()),
 | 
						|
    )
 | 
						|
    .await
 | 
						|
    .unwrap();
 | 
						|
}
 |