Reverter errors from taking a &'static str to String

This commit is contained in:
CosminPerRam 2022-11-25 18:42:10 +02:00
parent dc0926bab7
commit 7b44c5f7eb
10 changed files with 59 additions and 59 deletions

View file

@ -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(),