File tree Expand file tree Collapse file tree 5 files changed +6
-7
lines changed Expand file tree Collapse file tree 5 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ use crate::future::Future;
1010use crate :: task:: { Context , Poll , Waker } ;
1111
1212/// Set if the mutex is locked.
13- const LOCK : usize = 1 << 0 ;
13+ const LOCK : usize = 1 ;
1414
1515/// Set if there are tasks blocked on the mutex.
1616const BLOCKED : usize = 1 << 1 ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ use crate::future::Future;
1010use crate :: task:: { Context , Poll , Waker } ;
1111
1212/// Set if a write lock is held.
13- const WRITE_LOCK : usize = 1 << 0 ;
13+ const WRITE_LOCK : usize = 1 ;
1414
1515/// Set if there are read operations blocked on the lock.
1616const BLOCKED_READS : usize = 1 << 1 ;
Original file line number Diff line number Diff line change @@ -69,12 +69,11 @@ where
6969 let future = task_local:: add_finalizer ( future) ;
7070
7171 let future = async move {
72- let res = future. await ;
72+ future. await ;
7373 trace ! ( "block_on completed" , {
7474 parent_id: parent_id,
7575 child_id: child_id,
7676 } ) ;
77- res
7877 } ;
7978
8079 // Pin the future onto the stack.
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ fn random(n: u32) -> u32 {
135135 use std:: num:: Wrapping ;
136136
137137 thread_local ! {
138- static RNG : Cell <Wrapping <u32 >> = Cell :: new( Wrapping ( 1406868647 ) ) ;
138+ static RNG : Cell <Wrapping <u32 >> = Cell :: new( Wrapping ( 1_406_868_647 ) ) ;
139139 }
140140
141141 RNG . with ( |rng| {
@@ -152,6 +152,6 @@ fn random(n: u32) -> u32 {
152152 //
153153 // Author: Daniel Lemire
154154 // Source: https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
155- ( ( x. 0 as u64 ) . wrapping_mul ( n as u64 ) >> 32 ) as u32
155+ ( ( u64 :: from ( x. 0 ) ) . wrapping_mul ( u64:: from ( n ) ) >> 32 ) as u32
156156 } )
157157}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use crate::future::Future;
44use crate :: io;
55
66/// Task builder that configures the settings of a new task.
7- #[ derive( Debug ) ]
7+ #[ derive( Debug , Default ) ]
88pub struct Builder {
99 pub ( crate ) name : Option < String > ,
1010}
You can’t perform that action at this time.
0 commit comments