aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-protocol/src')
-rw-r--r--azalea-protocol/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/azalea-protocol/src/lib.rs b/azalea-protocol/src/lib.rs
index be706ebe..5e663c8f 100644
--- a/azalea-protocol/src/lib.rs
+++ b/azalea-protocol/src/lib.rs
@@ -58,6 +58,13 @@ impl TryFrom<&str> for ServerAddress {
Ok(ServerAddress { host, port })
}
}
+impl TryFrom<String> for ServerAddress {
+ type Error = String;
+
+ fn try_from(string: String) -> Result<Self, Self::Error> {
+ ServerAddress::try_from(string.as_str())
+ }
+}
impl From<SocketAddr> for ServerAddress {
/// Convert an existing `SocketAddr` into a `ServerAddress`. This just