diff options
Diffstat (limited to 'minecraft-protocol/src/mc_buf.rs')
| -rw-r--r-- | minecraft-protocol/src/mc_buf.rs | 4 |
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 } |
