@@ -71,9 +71,7 @@ fn wait_for_retry(
7171}
7272
7373fn take_retry_delay ( delay : & mut Duration , maximum : Duration ) -> Duration {
74- let current = * delay;
75- * delay = delay. saturating_mul ( 2 ) . min ( maximum) ;
76- current
74+ std:: mem:: replace ( delay, delay. saturating_mul ( 2 ) . min ( maximum) )
7775}
7876
7977#[ derive( Clone , Copy ) ]
@@ -225,8 +223,8 @@ fn run_session(
225223 // harmlessly; any other core error, such as a lost connection, ends the session.
226224 let race = std:: io:: Error :: from_raw_os_error ( result. wrapping_neg ( ) ) . kind ( )
227225 == std:: io:: ErrorKind :: NotFound ;
228- if id == pw:: core:: PW_ID_CORE && !race && fatal . borrow ( ) . is_none ( ) {
229- * fatal. borrow_mut ( ) = Some ( detail) ;
226+ if id == pw:: core:: PW_ID_CORE && !race {
227+ fatal. borrow_mut ( ) . get_or_insert ( detail) ;
230228 }
231229 } )
232230 . register ( )
@@ -367,7 +365,7 @@ impl CaptureState {
367365 . tap
368366 . node_id ( )
369367 . and_then ( |id| graph. node ( id) )
370- . map_or_else ( Vec :: new , |tap| policy:: desired_links ( & graph, & plan, tap) ) ;
368+ . map_or_default ( |tap| policy:: desired_links ( & graph, & plan, tap) ) ;
371369 self . owned_links . apply ( desired, now) ;
372370 let view = graph. view ( self . tap . node_id ( ) , config. device . as_deref ( ) ) ;
373371 if let Some ( selected) = & view. selected_device
@@ -475,7 +473,9 @@ impl OwnedLinks {
475473 * pw:: keys:: MEDIA_CATEGORY => "Capture" ,
476474 * pw:: keys:: MEDIA_ROLE => "Production" ,
477475 } ;
478- let link = ( self . core ) . create_object :: < pw:: link:: Link > ( LINK_FACTORY , & props) ?;
476+ let link = self
477+ . core
478+ . create_object :: < pw:: link:: Link > ( LINK_FACTORY , & props) ?;
479479 let state = Rc :: new ( Cell :: new ( OwnedLinkState :: Pending ) ) ;
480480 let fail = {
481481 let ( state, dirty) = ( Rc :: clone ( & state) , Rc :: clone ( & self . dirty ) ) ;
@@ -696,7 +696,7 @@ mod tests {
696696 // A replacement stream does not inherit the accepted time of the one it replaces, even
697697 // when it is accepted before reconcile sees it start.
698698 let mut stale = capture. tap . config ( ) . copied ( ) . expect ( "configured tap" ) ;
699- stale. passive = !stale . passive ;
699+ stale. passive . toggle ( ) ;
700700 capture. tap . configure ( stale) . expect ( "stale tap" ) ;
701701 writer. borrow_mut ( ) . set_status ( StreamStatus :: Paused ) ;
702702 capture. dirty . set ( true ) ;
0 commit comments