/// Update the ServerDescription's round trip time based on the rolling average.
Update the ServerDescription's round trip time based on the rolling average.
Update the ServerDescription ' s round trip time based on the rolling average .
fn update_round_trip_time(&self, server_description: &mut ServerDescription) {
        if let Some(old_rtt) = self
            .servers
            .get(&server_description.address)
            .and_then(|server_desc| server_desc.average_round_trip_time)
        {
            if let Some(new_rtt) = server_description.average_round_trip_time {
                server_description.average_round_trip_time =
                    Some((new_rtt / 5) + (old_rtt * 4 / 5));
            }
        }
    }
fn update_round_trip_time ( & self , server_description : & mut ServerDescription ) { if let Some ( old_rtt ) = self . servers . get ( & server_description . address ) . and_then ( | server_desc | server_desc . average_round_trip_time ) { if let Some ( new_rtt ) = server_description . average_round_trip_time { server_description . average_round_trip_time = Some ( ( new_rtt / 5 ) + ( old_rtt * 4 / 5 ) ) ; } } }
Update the ServerDescription's round trip time based on the rolling average.
Update the ServerDescription ' s round trip time based on the rolling average .
&self
server_description
&mut ServerDescription