[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

@ -40,15 +40,9 @@ pub fn query_bedrock(address: &str, port: Option<u16>) -> GDResult<BedrockRespon
}
fn port_or_java_default(port: Option<u16>) -> u16 {
match port {
None => 25565,
Some(port) => port
}
port.unwrap_or(25565)
}
fn port_or_bedrock_default(port: Option<u16>) -> u16 {
match port {
None => 19132,
Some(port) => port
}
port.unwrap_or(19132)
}