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:
parent
bbfca34133
commit
123c15a293
1 changed files with 5 additions and 5 deletions
|
@ -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 }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue