File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ impl RttEstimator {
197197 Duration :: from_millis ( self . rto as _ )
198198 }
199199
200+ #[ cfg( feature = "socket-tcp-bbr" ) ]
200201 pub ( super ) fn min_rtt ( & self ) -> Duration {
201202 Duration :: from_millis ( self . srtt as _ )
202203 }
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ pub(super) trait Controller {
4343
4444#[ derive( Debug ) ]
4545#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
46+ #[ allow( clippy:: large_enum_variant) ]
4647pub ( super ) enum AnyController {
4748 None ( no_control:: NoControl ) ,
4849
Original file line number Diff line number Diff line change @@ -59,31 +59,29 @@ impl BandwidthEstimation {
5959 return ;
6060 }
6161
62- let send_rate;
63- if self . sent_time . unwrap ( ) > self . prev_sent_time . unwrap ( ) {
64- send_rate = BandwidthEstimation :: bw_from_delta (
62+ let send_rate = if self . sent_time . unwrap ( ) > self . prev_sent_time . unwrap ( ) {
63+ BandwidthEstimation :: bw_from_delta (
6564 self . total_sent - self . prev_total_sent ,
6665 self . sent_time . unwrap ( ) - self . prev_sent_time . unwrap ( ) ,
6766 )
68- . unwrap_or ( 0 ) ;
67+ . unwrap_or ( 0 )
6968 } else {
70- send_rate = u64:: MAX ; // will take the min of send and ack, so this is just a skip
71- }
69+ u64:: MAX // will take the min of send and ack, so this is just a skip
70+ } ;
7271
73- let ack_rate;
74- if let Some ( prev_acked_time) = self . prev_acked_time {
72+ let ack_rate = if let Some ( prev_acked_time) = self . prev_acked_time {
7573 if self . acked_time . unwrap ( ) > prev_acked_time {
76- ack_rate = BandwidthEstimation :: bw_from_delta (
74+ BandwidthEstimation :: bw_from_delta (
7775 self . total_acked - self . prev_total_acked ,
7876 self . acked_time . unwrap ( ) - prev_acked_time,
7977 )
80- . unwrap_or ( 0 ) ;
78+ . unwrap_or ( 0 )
8179 } else {
82- ack_rate = 0 ;
80+ 0
8381 }
8482 } else {
85- ack_rate = 0 ;
86- }
83+ 0
84+ } ;
8785
8886 let bandwidth = send_rate. min ( ack_rate) ;
8987 if !app_limited && self . max_filter . get ( ) < bandwidth {
You can’t perform that action at this time.
0 commit comments