From 123c15a2936639244c3485c5db789c845f7c2e43 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 4 Jun 2025 12:16:12 +0600 Subject: [PATCH] fix hashset of blockstate into blockstates impl --- azalea-block/src/range.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azalea-block/src/range.rs b/azalea-block/src/range.rs index cbe77284..7960b5c4 100644 --- a/azalea-block/src/range.rs +++ b/azalea-block/src/range.rs @@ -47,16 +47,16 @@ impl Add for BlockStates { impl From> for BlockStates { fn from(set: HashSet) -> Self { - Self { - set: set.into_iter().map(|b| b.into()).collect(), - } + Self::from(&set) } } impl From<&HashSet> for BlockStates { fn from(set: &HashSet) -> Self { - Self { - set: set.iter().map(|&b| b.into()).collect(), + let mut block_states = HashSet::with_capacity(set.len()); + for &block in set { + block_states.extend(BlockStates::from(block)); } + Self { set: block_states } } }