mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
chore: run rustfmt
This commit is contained in:
parent
731818ffb1
commit
5d0834ac78
2 changed files with 8 additions and 6 deletions
|
|
@ -33,9 +33,10 @@ pub(crate) struct Unreal2Protocol {
|
||||||
impl Unreal2Protocol {
|
impl Unreal2Protocol {
|
||||||
pub fn new(address: &SocketAddr, timeout_settings: Option<TimeoutSettings>) -> GDResult<Self> {
|
pub fn new(address: &SocketAddr, timeout_settings: Option<TimeoutSettings>) -> GDResult<Self> {
|
||||||
let socket = UdpSocket::new(address, &timeout_settings)?;
|
let socket = UdpSocket::new(address, &timeout_settings)?;
|
||||||
let retry_count = timeout_settings
|
let retry_count = timeout_settings.as_ref().map_or_else(
|
||||||
.as_ref()
|
|| TimeoutSettings::default().get_retries(),
|
||||||
.map_or_else(|| TimeoutSettings::default().get_retries(), TimeoutSettings::get_retries);
|
TimeoutSettings::get_retries,
|
||||||
|
);
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
socket,
|
socket,
|
||||||
|
|
|
||||||
|
|
@ -127,9 +127,10 @@ static PACKET_SIZE: usize = 6144;
|
||||||
impl ValveProtocol {
|
impl ValveProtocol {
|
||||||
pub fn new(address: &SocketAddr, timeout_settings: Option<TimeoutSettings>) -> GDResult<Self> {
|
pub fn new(address: &SocketAddr, timeout_settings: Option<TimeoutSettings>) -> GDResult<Self> {
|
||||||
let socket = UdpSocket::new(address, &timeout_settings)?;
|
let socket = UdpSocket::new(address, &timeout_settings)?;
|
||||||
let retry_count = timeout_settings
|
let retry_count = timeout_settings.as_ref().map_or_else(
|
||||||
.as_ref()
|
|| TimeoutSettings::default().get_retries(),
|
||||||
.map_or_else(|| TimeoutSettings::default().get_retries(), |t| t.get_retries());
|
|t| t.get_retries(),
|
||||||
|
);
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
socket,
|
socket,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue