chg: don't assume that default features are available on all targets
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
This commit is contained in:
parent
aa4e313690
commit
0d713af4ac
1 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,7 @@ use core::{
|
|||
ops::Deref,
|
||||
slice::from_raw_parts,
|
||||
};
|
||||
use winter_utils::collections::Vec;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
@ -277,7 +278,12 @@ where
|
|||
blake3::hash(E::elements_as_bytes(elements))
|
||||
} else {
|
||||
let blen = elements.len() << 3;
|
||||
let mut bytes = vec![0u8; blen];
|
||||
|
||||
let mut bytes = Vec::with_capacity(blen);
|
||||
#[allow(clippy::uninit_vec)]
|
||||
unsafe {
|
||||
bytes.set_len(blen)
|
||||
}
|
||||
|
||||
for (idx, element) in E::as_base_elements(elements).iter().enumerate() {
|
||||
bytes[idx * 8..(idx + 1) * 8].copy_from_slice(&element.as_int().to_le_bytes());
|
||||
|
|
Loading…
Add table
Reference in a new issue