diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2026-01-13 10:51:45 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-13 10:51:45 -0600 |
| commit | b21ac946cafaacc9ee2478ea48ed9e72554f79ed (patch) | |
| tree | 4d05744b9801e94f5da6563d8fabddfb20d1c7b7 /azalea-protocol/src/packets/mod.rs | |
| parent | d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (diff) | |
| download | azalea-drasl-b21ac946cafaacc9ee2478ea48ed9e72554f79ed.tar.xz | |
Merge AzaleaRead and AzaleaWrite (#305)
Diffstat (limited to 'azalea-protocol/src/packets/mod.rs')
| -rw-r--r-- | azalea-protocol/src/packets/mod.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/azalea-protocol/src/packets/mod.rs b/azalea-protocol/src/packets/mod.rs index 9dd14311..202bc4ee 100644 --- a/azalea-protocol/src/packets/mod.rs +++ b/azalea-protocol/src/packets/mod.rs @@ -7,7 +7,7 @@ pub mod status; use std::io::{self, Cursor, Write}; -use azalea_buf::{AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; +use azalea_buf::{AzBuf, AzBufVar, BufReadError}; use crate::read::ReadPacketError; @@ -89,15 +89,12 @@ impl From<ClientIntention> for ConnectionProtocol { } } -impl azalea_buf::AzaleaRead for ClientIntention { +impl AzBuf for ClientIntention { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { let id = i32::azalea_read_var(buf)?; id.try_into() .map_err(|_| BufReadError::UnexpectedEnumVariant { id }) } -} - -impl AzaleaWrite for ClientIntention { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { (*self as i32).azalea_write_var(buf) } |
