aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-05-02 03:10:52 +0000
committerGitHub <noreply@github.com>2022-05-02 03:10:52 +0000
commit728f0399ff1a03f5ce8134b46e6150daf1e2076d (patch)
tree5a21ef239d8e5cabdc0b5d3d511e35dc25435041 /azalea-protocol/src/packets/game/clientbound_recipe_packet.rs
parentc2262a212328e7a9e00091d7b41a8d8bfb5b3007 (diff)
parente1b6bc965a3f71d64b4dc3075da21c578ab5b508 (diff)
downloadazalea-drasl-728f0399ff1a03f5ce8134b46e6150daf1e2076d.tar.xz
Merge pull request #4 from mat-1/sync-decoding
Reduce usage of AsyncRead
Diffstat (limited to 'azalea-protocol/src/packets/game/clientbound_recipe_packet.rs')
-rw-r--r--azalea-protocol/src/packets/game/clientbound_recipe_packet.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs b/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs
index 69f26ddc..4847bbf8 100644
--- a/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs
@@ -1,8 +1,6 @@
-use async_trait::async_trait;
-use azalea_chat::component::Component;
use azalea_core::{resource_location::ResourceLocation, Slot};
use packet_macros::{GamePacket, McBufReadable, McBufWritable};
-use tokio::io::AsyncRead;
+use std::io::Read;
use crate::mc_buf::{McBufReadable, McBufWritable, Readable, Writable};
@@ -42,13 +40,9 @@ impl McBufWritable for State {
Ok(())
}
}
-#[async_trait]
impl McBufReadable for State {
- async fn read_into<R>(buf: &mut R) -> Result<Self, String>
- where
- R: AsyncRead + std::marker::Unpin + std::marker::Send,
- {
- let state = buf.read_varint().await?.try_into().unwrap();
+ fn read_into(buf: &mut impl Read) -> Result<Self, String> {
+ let state = buf.read_varint()?.try_into().unwrap();
Ok(match state {
0 => State::Init,
1 => State::Add,