@@ -1146,11 +1146,7 @@ impl Connection {
11461146 self . spaces [ SpaceId :: Data ] . pending . new_cids . push ( frame) ;
11471147 } ) ;
11481148 // Update Timer::PushNewCid
1149- if self
1150- . timers
1151- . get ( Timer :: PushNewCid )
1152- . map_or ( true , |x| x <= now)
1153- {
1149+ if self . timers . get ( Timer :: PushNewCid ) . is_none_or ( |x| x <= now) {
11541150 self . reset_cid_retirement ( ) ;
11551151 }
11561152 }
@@ -1443,10 +1439,7 @@ impl Connection {
14431439 }
14441440 let new_largest = {
14451441 let space = & mut self . spaces [ space] ;
1446- if space
1447- . largest_acked_packet
1448- . map_or ( true , |pn| ack. largest > pn)
1449- {
1442+ if space. largest_acked_packet . is_none_or ( |pn| ack. largest > pn) {
14501443 space. largest_acked_packet = Some ( ack. largest ) ;
14511444 if let Some ( info) = space. sent_packets . get ( & ack. largest ) {
14521445 // This should always succeed, but a misbehaving peer might ACK a packet we
@@ -1890,7 +1883,7 @@ impl Connection {
18901883 continue ;
18911884 } ;
18921885 let pto = last_ack_eliciting + duration;
1893- if result. map_or ( true , |( earliest_pto, _) | pto < earliest_pto) {
1886+ if result. is_none_or ( |( earliest_pto, _) | pto < earliest_pto) {
18941887 result = Some ( ( pto, space) ) ;
18951888 }
18961889 }
@@ -3672,7 +3665,7 @@ impl Connection {
36723665 . filter ( |& & t| !matches ! ( t, Timer :: KeepAlive | Timer :: PushNewCid | Timer :: KeyDiscard ) )
36733666 . filter_map ( |& t| Some ( ( t, self . timers . get ( t) ?) ) )
36743667 . min_by_key ( |& ( _, time) | time)
3675- . map_or ( true , |( timer, _) | timer == Timer :: Idle )
3668+ . is_none_or ( |( timer, _) | timer == Timer :: Idle )
36763669 }
36773670
36783671 /// Whether explicit congestion notification is in use on outgoing packets.
0 commit comments