diff options
| author | mat <git@matdoes.dev> | 2025-12-19 13:07:19 +1100 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-12-19 13:07:19 +1100 |
| commit | b300cd7b36a5ba6f5be58e1942da8e2c866106e6 (patch) | |
| tree | 71f2ff46aae542aa9f78097c9442dea9130be3de /azalea-buf/src/read.rs | |
| parent | 7c468692c7adf6c9a4796aa8010f20ced4618327 (diff) | |
| download | azalea-drasl-b300cd7b36a5ba6f5be58e1942da8e2c866106e6.tar.xz | |
smaller EntityDataValue type
Diffstat (limited to 'azalea-buf/src/read.rs')
| -rw-r--r-- | azalea-buf/src/read.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/azalea-buf/src/read.rs b/azalea-buf/src/read.rs index 7cea9695..f4d6a951 100644 --- a/azalea-buf/src/read.rs +++ b/azalea-buf/src/read.rs @@ -285,11 +285,21 @@ impl AzaleaRead for String { read_utf_with_len(buf, MAX_STRING_LENGTH.into()) } } +impl AzaleaRead for Box<str> { + fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { + String::azalea_read(buf).map(Into::into) + } +} impl AzaleaReadLimited for String { fn azalea_read_limited(buf: &mut Cursor<&[u8]>, limit: usize) -> Result<Self, BufReadError> { read_utf_with_len(buf, limit as u32) } } +impl AzaleaReadLimited for Box<str> { + fn azalea_read_limited(buf: &mut Cursor<&[u8]>, limit: usize) -> Result<Self, BufReadError> { + String::azalea_read_limited(buf, limit).map(Into::into) + } +} impl AzaleaRead for u32 { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { |
