diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b867f7..c878ae7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ Who knows what the future holds... # 0.0.6 - ??/??/2022 -[Minecraft](https://www.minecraft.com) implementation (bedrock not supported yet). +[Minecraft](https://www.minecraft.com) support (bedrock not supported yet). [7 Days To Die](https://store.steampowered.com/app/251570/7_Days_to_Die/) support. [ARK: Survival Evolved](https://store.steampowered.com/app/346110/ARK_Survival_Evolved/) support. [Unturned](https://store.steampowered.com/app/304930/Unturned/) support. diff --git a/src/errors.rs b/src/errors.rs index 099bb0c..148aa7d 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -26,8 +26,6 @@ pub enum GDError { UnknownEnumCast, /// The server queried is not from the queried game. BadGame(String), - /// Problems occurred while dns resolving. - DnsResolve(String), /// Couldn't bind a socket. SocketBind(String), /// Invalid input. @@ -53,7 +51,6 @@ impl fmt::Display for GDError { GDError::Decompress(details) => write!(f, "Couldn't decompress data: {details}"), GDError::UnknownEnumCast => write!(f, "Unknown enum cast encountered."), GDError::BadGame(details) => write!(f, "Queried another game that the supposed one: {details}"), - GDError::DnsResolve(details) => write!(f, "DNS Resolve: {details}"), GDError::SocketBind(details) => write!(f, "Socket bind: {details}"), GDError::InvalidInput(details) => write!(f, "Invalid input: {details}"), GDError::SocketConnect(details) => write!(f, "Socket connect: {details}"), diff --git a/src/utils.rs b/src/utils.rs index 178bc07..3fbaa7f 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -12,8 +12,8 @@ pub fn error_by_expected_size(expected: usize, size: usize) -> GDResult<()> { } } -pub fn address_and_port_as_string(address: &str, port: u16) -> GDResult { - Ok(address.to_string() + ":" + &*port.to_string()) +pub fn address_and_port_as_string(address: &str, port: u16) -> String { + address.to_string() + ":" + &*port.to_string() } pub fn u8_lower_upper(n: u8) -> (u8, u8) { @@ -121,8 +121,7 @@ mod tests { #[test] fn address_and_port_as_string_test() { - assert_eq!(address_and_port_as_string("192.168.0.1", 27015).unwrap(), "192.168.0.1:27015"); - assert!(address_and_port_as_string("not_existent_address", 9999).is_err()); + assert_eq!(address_and_port_as_string("192.168.0.1", 27015), "192.168.0.1:27015"); } #[test]