mirror of
https://github.com/Tribufu/rust-gamedig
synced 2026-08-17 02:41:06 +00:00
[Games] Use port.unwrap_or instead of matching it
This commit is contained in:
parent
5f06f58df8
commit
59994bc086
44 changed files with 45 additions and 180 deletions
|
|
@ -82,10 +82,7 @@ impl Response {
|
|||
}
|
||||
|
||||
pub fn query(address: &str, port: Option<u16>) -> GDResult<Response> {
|
||||
let valve_response = valve::query(address, match port {
|
||||
None => 27015,
|
||||
Some(port) => port
|
||||
}, SteamApp::TS.as_engine(), None, None)?;
|
||||
let valve_response = valve::query(address, port.unwrap_or(27015), SteamApp::TS.as_engine(), None, None)?;
|
||||
|
||||
Ok(Response::new_from_valve_response(valve_response))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue