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-core/src/difficulty.rs | |
| parent | d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (diff) | |
| download | azalea-drasl-b21ac946cafaacc9ee2478ea48ed9e72554f79ed.tar.xz | |
Merge AzaleaRead and AzaleaWrite (#305)
Diffstat (limited to 'azalea-core/src/difficulty.rs')
| -rw-r--r-- | azalea-core/src/difficulty.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/azalea-core/src/difficulty.rs b/azalea-core/src/difficulty.rs index 7a018a8e..81db0f3a 100644 --- a/azalea-core/src/difficulty.rs +++ b/azalea-core/src/difficulty.rs @@ -3,7 +3,7 @@ use std::{ io::{self, Cursor, Write}, }; -use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; +use azalea_buf::{AzBuf, BufReadError}; #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub enum Difficulty { @@ -61,13 +61,10 @@ impl Difficulty { } } -impl AzaleaRead for Difficulty { +impl AzBuf for Difficulty { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { Ok(Difficulty::by_id(u8::azalea_read(buf)?)) } -} - -impl AzaleaWrite for Difficulty { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { u8::azalea_write(&self.id(), buf) } |
