mirror of https://github.com/zcash/orchard.git
Remove unnecessary usage of `Vec`
This commit is contained in:
parent
30f9452743
commit
4ec036c851
|
@ -161,27 +161,18 @@ mod tests {
|
|||
#[test]
|
||||
fn i2lebsp_k_round_trip() {
|
||||
{
|
||||
let bitstring = (0..K).map(|_| rand::random()).collect::<Vec<_>>();
|
||||
assert_eq!(
|
||||
i2lebsp_k(lebs2ip_k(&bitstring) as usize).to_vec(),
|
||||
bitstring
|
||||
);
|
||||
let bitstring = [0; K].map(|_| rand::random());
|
||||
assert_eq!(i2lebsp_k(lebs2ip_k(&bitstring) as usize), bitstring);
|
||||
}
|
||||
|
||||
{
|
||||
let bitstring = [false; K];
|
||||
assert_eq!(
|
||||
i2lebsp_k(lebs2ip_k(&bitstring) as usize).to_vec(),
|
||||
bitstring
|
||||
);
|
||||
assert_eq!(i2lebsp_k(lebs2ip_k(&bitstring) as usize), bitstring);
|
||||
}
|
||||
|
||||
{
|
||||
let bitstring = [true; K];
|
||||
assert_eq!(
|
||||
i2lebsp_k(lebs2ip_k(&bitstring) as usize).to_vec(),
|
||||
bitstring
|
||||
);
|
||||
assert_eq!(i2lebsp_k(lebs2ip_k(&bitstring) as usize), bitstring);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -302,11 +302,8 @@ mod tests {
|
|||
#[test]
|
||||
fn i2lebsp_round_trip() {
|
||||
{
|
||||
let bitstring = (0..64).map(|_| rand::random()).collect::<Vec<_>>();
|
||||
assert_eq!(
|
||||
i2lebsp::<64>(lebs2ip::<64>(&bitstring.clone().try_into().unwrap())).to_vec(),
|
||||
bitstring
|
||||
);
|
||||
let bitstring = [0; 64].map(|_| rand::random());
|
||||
assert_eq!(i2lebsp(lebs2ip(&bitstring)), bitstring);
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue