@@ -510,7 +510,9 @@ impl RwLock {
510510 // `state`, so the first non-null tail field will be current
511511 // (invariant 2). Invariant 4 is fullfilled since `find_tail`
512512 // was called on this node, which ensures all backlinks are set.
513- unsafe { to_node ( state) . as_ref ( ) . tail . set ( Some ( prev) ) ; }
513+ unsafe {
514+ to_node ( state) . as_ref ( ) . tail . set ( Some ( prev) ) ;
515+ }
514516
515517 // Release the queue lock. Doing this by subtraction is more
516518 // efficient on modern processors since it is a single instruction
@@ -520,22 +522,28 @@ impl RwLock {
520522
521523 // The tail was split off and the lock released. Mark the node as
522524 // completed.
523- unsafe { return Node :: complete ( tail) ; }
525+ unsafe {
526+ return Node :: complete ( tail) ;
527+ }
524528 } else {
525529 // The next waiter is a reader or the queue only consists of one
526530 // waiter. Just wake all threads.
527531
528532 // The lock cannot be locked (checked above), so mark it as
529533 // unlocked to reset the queue.
530- if let Err ( new) = self . state . compare_exchange_weak ( state, UNLOCKED , Release , Acquire ) {
534+ if let Err ( new) =
535+ self . state . compare_exchange_weak ( state, UNLOCKED , Release , Acquire )
536+ {
531537 state = new;
532538 continue ;
533539 }
534540
535541 let mut current = tail;
536542 loop {
537543 let prev = unsafe { current. as_ref ( ) . prev . get ( ) } ;
538- unsafe { Node :: complete ( current) ; }
544+ unsafe {
545+ Node :: complete ( current) ;
546+ }
539547 match prev {
540548 Some ( prev) => current = prev,
541549 None => return ,
0 commit comments