From 2803e9ef0d785538a23adceba44d45b162629979 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 26 Oct 2023 22:26:07 -0500 Subject: [PATCH] remove some more #![feature]s --- azalea-buf/src/lib.rs | 2 +- azalea-core/src/bitset.rs | 2 +- azalea-nbt/src/lib.rs | 1 - azalea-world/src/chunk_storage.rs | 4 ++-- azalea-world/src/lib.rs | 1 - azalea/examples/testbot.rs | 2 -- azalea/src/lib.rs | 1 - azalea/src/swarm/mod.rs | 20 +++++++++++--------- 8 files changed, 15 insertions(+), 18 deletions(-) diff --git a/azalea-buf/src/lib.rs b/azalea-buf/src/lib.rs index d0eec5d4e..fbde36847 100755 --- a/azalea-buf/src/lib.rs +++ b/azalea-buf/src/lib.rs @@ -1,6 +1,6 @@ #![doc = include_str!("../README.md")] #![feature(min_specialization)] -// these two are necessary for thiserror backtraces +// this is necessary for thiserror backtraces #![feature(error_generic_member_access)] mod definitions; diff --git a/azalea-core/src/bitset.rs b/azalea-core/src/bitset.rs index 52a341545..0be04a57b 100755 --- a/azalea-core/src/bitset.rs +++ b/azalea-core/src/bitset.rs @@ -127,7 +127,7 @@ impl From> for BitSet { /// A list of bits with a known fixed size. /// /// Note that this is primarily meant for fast serialization and deserialization -/// Minecraft, if you don't need that you should use the `fixedbitset` crate +/// for Minecraft, if you don't need that you should use the `fixedbitset` crate /// since it's approximately 20% faster (since it stores the data as usizes /// instead of u8s) #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/azalea-nbt/src/lib.rs b/azalea-nbt/src/lib.rs index 740bd9e38..1a636520c 100755 --- a/azalea-nbt/src/lib.rs +++ b/azalea-nbt/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] -#![feature(min_specialization)] mod decode; mod encode; diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index aad0f979d..03bdcbb56 100755 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -436,8 +436,8 @@ impl Default for ChunkStorage { #[inline] pub fn section_index(y: i32, min_y: i32) -> u32 { assert!(y >= min_y, "y ({y}) must be at least {min_y}"); - let min_section_index = min_y.div_floor(16); - (y.div_floor(16) - min_section_index) as u32 + let min_section_index = min_y >> 4; + ((y >> 4) - min_section_index) as u32 } #[cfg(test)] diff --git a/azalea-world/src/lib.rs b/azalea-world/src/lib.rs index 55e476764..6677b326e 100644 --- a/azalea-world/src/lib.rs +++ b/azalea-world/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] -#![feature(int_roundings)] #![feature(error_generic_member_access)] mod bit_storage; diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs index de36a7ae6..10bb9e4a0 100644 --- a/azalea/examples/testbot.rs +++ b/azalea/examples/testbot.rs @@ -1,7 +1,5 @@ //! a bot for testing new azalea features -#![feature(type_alias_impl_trait)] - use azalea::ecs::query::With; use azalea::entity::{metadata::Player, EyeHeight, Position}; use azalea::interact::HitResultComponent; diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index bfa38fdad..fa9d2e5ad 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] -#![feature(async_closure)] #![allow(incomplete_features)] #![feature(type_changing_struct_update)] #![feature(lazy_cell)] diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 6fae5d34b..1f31db98c 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -357,15 +357,17 @@ where } else { // otherwise, join all at once let swarm_borrow = &swarm_clone; - join_all(accounts.iter().zip(states).map( - async move |(account, state)| -> Result<(), JoinError> { - swarm_borrow - .clone() - .add_with_exponential_backoff(account, state) - .await; - Ok(()) - }, - )) + join_all( + accounts + .iter() + .zip(states) + .map(move |(account, state)| async { + swarm_borrow + .clone() + .add_with_exponential_backoff(account, state) + .await; + }), + ) .await; } });