[Games] Use port.unwrap_or instead of matching it

This commit is contained in:
CosminPerRam 2023-03-03 18:02:54 +02:00
parent 5f06f58df8
commit 59994bc086
44 changed files with 45 additions and 180 deletions

View file

@ -3,10 +3,7 @@ use crate::protocols::valve;
use crate::protocols::valve::{game, SteamApp};
pub fn query(address: &str, port: Option<u16>) -> GDResult<game::Response> {
let valve_response = valve::query(address, match port {
None => 27015,
Some(port) => port
}, SteamApp::DOD.as_engine(), None, None)?;
let valve_response = valve::query(address, port.unwrap_or(27015), SteamApp::DOD.as_engine(), None, None)?;
Ok(game::Response::new_from_valve_response(valve_response))
}