aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/mc_buf/read.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-protocol/src/mc_buf/read.rs')
-rwxr-xr-xazalea-protocol/src/mc_buf/read.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/azalea-protocol/src/mc_buf/read.rs b/azalea-protocol/src/mc_buf/read.rs
index 3d1aa0b3..a0e3e79f 100755
--- a/azalea-protocol/src/mc_buf/read.rs
+++ b/azalea-protocol/src/mc_buf/read.rs
@@ -272,7 +272,7 @@ impl McBufReadable for UnsizedByteArray {
#[async_trait]
impl<T: McBufReadable + Send> McBufReadable for Vec<T> {
- async fn read_into<R>(buf: &mut R) -> Result<Self, String>
+ default async fn read_into<R>(buf: &mut R) -> Result<Self, String>
where
R: AsyncRead + std::marker::Unpin + std::marker::Send,
{
@@ -285,6 +285,16 @@ impl<T: McBufReadable + Send> McBufReadable for Vec<T> {
}
}
+#[async_trait]
+impl McBufReadable for Vec<u8> {
+ async fn read_into<R>(buf: &mut R) -> Result<Self, String>
+ where
+ R: AsyncRead + std::marker::Unpin + std::marker::Send,
+ {
+ buf.read_byte_array().await
+ }
+}
+
// string
#[async_trait]
impl McBufReadable for String {