1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

fix hashset of blockstate into blockstates impl

This commit is contained in:
mat 2025-06-04 12:16:12 +06:00
parent bbfca34133
commit 123c15a293

View file

@ -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 }
}
}