aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/lib.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-10-12 23:01:54 +0300
committermat <git@matdoes.dev>2025-10-12 23:01:54 +0300
commitee2575794e91b9457a74a95daf1dcc707058cd58 (patch)
treedf725850ef18ded5ce3f6552e17095d0f704ae84 /azalea-protocol/src/lib.rs
parent1a1402954b07cd77615d0afc026c73b008787f51 (diff)
downloadazalea-drasl-ee2575794e91b9457a74a95daf1dcc707058cd58.tar.xz
upgrade deps and clean up lots of doc comments
Diffstat (limited to 'azalea-protocol/src/lib.rs')
-rw-r--r--azalea-protocol/src/lib.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/azalea-protocol/src/lib.rs b/azalea-protocol/src/lib.rs
index fd092293..fdba34bc 100644
--- a/azalea-protocol/src/lib.rs
+++ b/azalea-protocol/src/lib.rs
@@ -71,9 +71,11 @@ impl TryFrom<String> for ServerAddress {
}
impl From<SocketAddr> for ServerAddress {
- /// Convert an existing `SocketAddr` into a `ServerAddress`. This just
- /// converts the ip to a string and passes along the port. The resolver
- /// will realize it's already an IP address and not do any DNS requests.
+ /// Convert an existing `SocketAddr` into a `ServerAddress`.
+ ///
+ /// This just converts the IP to a string and passes along the port. The
+ /// resolver will realize it's already an IP address and not do any DNS
+ /// requests.
fn from(addr: SocketAddr) -> Self {
ServerAddress {
host: addr.ip().to_string(),
@@ -88,8 +90,9 @@ impl Display for ServerAddress {
}
}
-/// Serde deserialization for ServerAddress. This is useful for config file
-/// usage.
+/// Serde deserialization for ServerAddress.
+///
+/// This is useful if you're storing the server address in a config file.
impl<'de> serde::Deserialize<'de> for ServerAddress {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
@@ -100,8 +103,9 @@ impl<'de> serde::Deserialize<'de> for ServerAddress {
}
}
-/// Serde serialization for ServerAddress. This uses the Display impl, so it
-/// will serialize to a string.
+/// Serde serialization for ServerAddress.
+///
+/// This uses the Display impl, so it will serialize to a string.
impl serde::Serialize for ServerAddress {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where