aboutsummaryrefslogtreecommitdiff
path: root/minecraft-protocol/src/mc_buf.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-12-10 00:54:58 -0600
committermat <github@matdoes.dev>2021-12-10 00:54:58 -0600
commitbe762fc5d37ba48386996afb4c5ba0c94aaf5883 (patch)
treea7c96227c51e291e4e59eab7a66c6bc223973e06 /minecraft-protocol/src/mc_buf.rs
parentf64750afdd9b18379f706df66c32806b6d21bbe8 (diff)
downloadazalea-drasl-be762fc5d37ba48386996afb4c5ba0c94aaf5883.tar.xz
rust is driving me insane
Diffstat (limited to 'minecraft-protocol/src/mc_buf.rs')
-rw-r--r--minecraft-protocol/src/mc_buf.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/minecraft-protocol/src/mc_buf.rs b/minecraft-protocol/src/mc_buf.rs
index 087e66a1..b83a9599 100644
--- a/minecraft-protocol/src/mc_buf.rs
+++ b/minecraft-protocol/src/mc_buf.rs
@@ -146,7 +146,9 @@ pub fn write_utf_with_len(buf: &mut Vec<u8>, string: &String, len: usize) {
write_bytes(buf, string.as_bytes());
}
-pub async fn read_utf<T: AsyncRead + std::marker::Unpin>(buf: &mut T) -> Result<String, String> {
+pub async fn read_utf<T: AsyncRead + std::marker::Unpin>(
+ buf: &mut BufReader<T>,
+) -> Result<String, String> {
read_utf_with_len(buf, MAX_STRING_LENGTH.into()).await
}