diff options
| author | mat <git@matdoes.dev> | 2025-06-04 12:16:12 +0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-04 12:16:12 +0600 |
| commit | 123c15a2936639244c3485c5db789c845f7c2e43 (patch) | |
| tree | bc71a9d1a728c2ed0674a021ac41e7272d08f6f6 | |
| parent | bbfca34133fdb97a732a60a0a11ca4ba3276a63a (diff) | |
| download | azalea-drasl-123c15a2936639244c3485c5db789c845f7c2e43.tar.xz | |
fix hashset of blockstate into blockstates impl
| -rw-r--r-- | azalea-block/src/range.rs | 10 |
1 files 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<HashSet<azalea_registry::Block>> for BlockStates { fn from(set: HashSet<azalea_registry::Block>) -> Self { - Self { - set: set.into_iter().map(|b| b.into()).collect(), - } + Self::from(&set) } } impl From<&HashSet<azalea_registry::Block>> for BlockStates { fn from(set: &HashSet<azalea_registry::Block>) -> 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 } } } |
