File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ pub static RUNTIME: Lazy<Runtime> = Lazy::new(|| {
22
22
. unwrap_or_else ( |_| num_cpus:: get ( ) )
23
23
. max ( 1 ) ;
24
24
25
- let thread_name = env:: var ( "ASYNC_STD_THREAD_NAME" ) . unwrap_or ( "async-std/runtime" . to_string ( ) ) ;
25
+ let thread_name =
26
+ env:: var ( "ASYNC_STD_THREAD_NAME" ) . unwrap_or_else ( |_| "async-std/runtime" . to_string ( ) ) ;
26
27
27
28
for _ in 0 ..thread_count {
28
29
thread:: Builder :: new ( )
Original file line number Diff line number Diff line change 41
41
let mut this = self . project ( ) ;
42
42
let next = futures_core:: ready!( this. stream. as_mut( ) . poll_next( cx) ) ;
43
43
44
- Poll :: Ready ( next. and_then ( |x| {
44
+ Poll :: Ready ( next. map ( |x| {
45
45
( this. f ) ( & x) ;
46
- Some ( x )
46
+ x
47
47
} ) )
48
48
}
49
49
}
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ impl Builder {
41
41
#[ cfg( not( target_os = "unknown" ) ) ]
42
42
once_cell:: sync:: Lazy :: force ( & crate :: rt:: RUNTIME ) ;
43
43
44
- let tag = TaskLocalsWrapper :: new ( task. clone ( ) ) ;
44
+ let tag = TaskLocalsWrapper :: new ( task) ;
45
45
46
46
SupportTaskLocals { tag, future }
47
47
}
You can’t perform that action at this time.
0 commit comments