From a64c6505049082175224802c5be51ac8f0cf4677 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 30 May 2025 12:59:08 -1345 Subject: make fixedbitset require generic const exprs again :3 --- azalea-protocol/src/common/client_information.rs | 4 ++-- azalea-protocol/src/common/movements.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'azalea-protocol/src/common') diff --git a/azalea-protocol/src/common/client_information.rs b/azalea-protocol/src/common/client_information.rs index f2290fe7..6f5e05e2 100644 --- a/azalea-protocol/src/common/client_information.rs +++ b/azalea-protocol/src/common/client_information.rs @@ -97,7 +97,7 @@ impl Default for ModelCustomization { impl AzaleaRead for ModelCustomization { fn azalea_read(buf: &mut std::io::Cursor<&[u8]>) -> Result { - let set = FixedBitSet::<{ 7_usize.div_ceil(8) }>::azalea_read(buf)?; + let set = FixedBitSet::<7>::azalea_read(buf)?; Ok(Self { cape: set.index(0), jacket: set.index(1), @@ -112,7 +112,7 @@ impl AzaleaRead for ModelCustomization { impl AzaleaWrite for ModelCustomization { fn azalea_write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> { - let mut set = FixedBitSet::<{ 7_usize.div_ceil(8) }>::new(); + let mut set = FixedBitSet::<7>::new(); if self.cape { set.set(0); } diff --git a/azalea-protocol/src/common/movements.rs b/azalea-protocol/src/common/movements.rs index a3898805..cf51a57c 100644 --- a/azalea-protocol/src/common/movements.rs +++ b/azalea-protocol/src/common/movements.rs @@ -32,7 +32,7 @@ pub struct RelativeMovements { impl AzaleaRead for RelativeMovements { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result { // yes minecraft seriously wastes that many bits, smh - let set = FixedBitSet::<{ 32_usize.div_ceil(8) }>::azalea_read(buf)?; + let set = FixedBitSet::<32>::azalea_read(buf)?; Ok(RelativeMovements { x: set.index(0), y: set.index(1), @@ -49,7 +49,7 @@ impl AzaleaRead for RelativeMovements { impl AzaleaWrite for RelativeMovements { fn azalea_write(&self, buf: &mut impl Write) -> Result<(), io::Error> { - let mut set = FixedBitSet::<{ 32_usize.div_ceil(8) }>::new(); + let mut set = FixedBitSet::<32>::new(); let mut set_bit = |index: usize, value: bool| { if value { set.set(index); -- cgit v1.2.3