mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +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
|
// Find the maximum length of the string
|
||||||
let length = *data
|
let length = *data
|
||||||
.first()
|
.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
|
// Find the position of the delimiter in the data. If the delimiter is not
|
||||||
// found, the length is returned.
|
// found, the length is returned.
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ impl HttpClient {
|
||||||
let host = http_settings
|
let host = http_settings
|
||||||
.hostname
|
.hostname
|
||||||
.map(S::into)
|
.map(S::into)
|
||||||
.unwrap_or(address.ip().to_string());
|
.unwrap_or_else(|| address.ip().to_string());
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
client,
|
client,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue