mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
perf: use of ok_or followed by a function call
This commit is contained in:
parent
9c3e6cb51f
commit
f746fad157
1 changed files with 1 additions and 1 deletions
|
|
@ -97,7 +97,7 @@ pub fn query_with_timeout(
|
|||
|
||||
let players_maximum = server_vars
|
||||
.remove("maxplayers")
|
||||
.ok_or(PacketBad.context("Server variables missing maxplayers"))?
|
||||
.ok_or_else(|| PacketBad.context("Server variables missing maxplayers"))?
|
||||
.parse()
|
||||
.map_err(|e| TypeParse.context(e))?;
|
||||
let players_online = match server_vars.remove("numplayers") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue