[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,8 +3,5 @@ use crate::protocols::gamespy;
use crate::protocols::gamespy::Response;
pub fn query(address: &str, port: Option<u16>) -> GDResult<Response> {
gamespy::one::query(address, match port {
None => 23000,
Some(port) => port
}, None)
gamespy::one::query(address, port.unwrap_or(23000), None)
}