mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-06 07:17:27 +00:00
feat: replace two cases of not using fun call on unwrapping
This commit is contained in:
parent
c2f6a68648
commit
78b52c0d23
2 changed files with 2 additions and 2 deletions
|
|
@ -378,7 +378,7 @@ impl StringDecoder for Utf8LengthPrefixedDecoder {
|
|||
// Find the maximum length of the string
|
||||
let length = *data
|
||||
.first()
|
||||
.ok_or(PacketBad.context("Length of string not found"))?;
|
||||
.ok_or_else(|| PacketBad.context("Length of string not found"))?;
|
||||
|
||||
// Find the position of the delimiter in the data. If the delimiter is not
|
||||
// found, the length is returned.
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ impl HttpClient {
|
|||
let host = http_settings
|
||||
.hostname
|
||||
.map(S::into)
|
||||
.unwrap_or(address.ip().to_string());
|
||||
.unwrap_or_else(|| address.ip().to_string());
|
||||
|
||||
Ok(Self {
|
||||
client,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue