mirror of
https://github.com/Tribufu/rust-gamedig
synced 2026-08-09 23:21: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
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue