diff --git a/crates/lib/src/protocols/unreal2/protocol.rs b/crates/lib/src/protocols/unreal2/protocol.rs index 9b6e70c..b1326b8 100644 --- a/crates/lib/src/protocols/unreal2/protocol.rs +++ b/crates/lib/src/protocols/unreal2/protocol.rs @@ -33,9 +33,10 @@ pub(crate) struct Unreal2Protocol { impl Unreal2Protocol { pub fn new(address: &SocketAddr, timeout_settings: Option) -> GDResult { let socket = UdpSocket::new(address, &timeout_settings)?; - let retry_count = timeout_settings - .as_ref() - .map_or_else(|| TimeoutSettings::default().get_retries(), TimeoutSettings::get_retries); + let retry_count = timeout_settings.as_ref().map_or_else( + || TimeoutSettings::default().get_retries(), + TimeoutSettings::get_retries, + ); Ok(Self { socket, diff --git a/crates/lib/src/protocols/valve/protocol.rs b/crates/lib/src/protocols/valve/protocol.rs index f655fae..b4ec3c6 100644 --- a/crates/lib/src/protocols/valve/protocol.rs +++ b/crates/lib/src/protocols/valve/protocol.rs @@ -127,9 +127,10 @@ static PACKET_SIZE: usize = 6144; impl ValveProtocol { pub fn new(address: &SocketAddr, timeout_settings: Option) -> GDResult { let socket = UdpSocket::new(address, &timeout_settings)?; - let retry_count = timeout_settings - .as_ref() - .map_or_else(|| TimeoutSettings::default().get_retries(), |t| t.get_retries()); + let retry_count = timeout_settings.as_ref().map_or_else( + || TimeoutSettings::default().get_retries(), + |t| t.get_retries(), + ); Ok(Self { socket,