mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +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
|
|
@ -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 => 27016,
|
||||
Some(port) => port
|
||||
}, SteamApp::ROR2.as_engine(), None, None)?;
|
||||
let valve_response = valve::query(address, port.unwrap_or(27016), SteamApp::ROR2.as_engine(), None, None)?;
|
||||
|
||||
Ok(game::Response::new_from_valve_response(valve_response))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue