mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Reverter errors from taking a &'static str to String
This commit is contained in:
parent
dc0926bab7
commit
7b44c5f7eb
10 changed files with 59 additions and 59 deletions
|
|
@ -31,7 +31,7 @@ impl LegacyBV1_8 {
|
|||
let mut pos = 0;
|
||||
|
||||
if get_u8(&buf, &mut pos)? != 0xFF {
|
||||
return Err(GDError::ProtocolFormat("Expected 0xFF at the begin of the packet."));
|
||||
return Err(GDError::ProtocolFormat("Expected 0xFF at the begin of the packet.".to_string()));
|
||||
}
|
||||
|
||||
let length = get_u16_be(&buf, &mut pos)? * 2;
|
||||
|
|
@ -44,9 +44,9 @@ impl LegacyBV1_8 {
|
|||
|
||||
let description = split[0].to_string();
|
||||
let online_players = split[1].parse()
|
||||
.map_err(|_| GDError::PacketBad("Failed to parse to expected int."))?;
|
||||
.map_err(|_| GDError::PacketBad("Failed to parse to expected int.".to_string()))?;
|
||||
let max_players = split[2].parse()
|
||||
.map_err(|_| GDError::PacketBad("Failed to parse to expected int."))?;
|
||||
.map_err(|_| GDError::PacketBad("Failed to parse to expected int.".to_string()))?;
|
||||
|
||||
Ok(Response {
|
||||
version_name: "Beta 1.8+".to_string(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue