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]
|
#[test]
|
||||||
fn i2lebsp_k_round_trip() {
|
fn i2lebsp_k_round_trip() {
|
||||||
{
|
{
|
||||||
let bitstring = (0..K).map(|_| rand::random()).collect::<Vec<_>>();
|
let bitstring = [0; K].map(|_| rand::random());
|
||||||
assert_eq!(
|
assert_eq!(i2lebsp_k(lebs2ip_k(&bitstring) as usize), bitstring);
|
||||||
i2lebsp_k(lebs2ip_k(&bitstring) as usize).to_vec(),
|
|
||||||
bitstring
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
let bitstring = [false; K];
|
let bitstring = [false; K];
|
||||||
assert_eq!(
|
assert_eq!(i2lebsp_k(lebs2ip_k(&bitstring) as usize), bitstring);
|
||||||
i2lebsp_k(lebs2ip_k(&bitstring) as usize).to_vec(),
|
|
||||||
bitstring
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
let bitstring = [true; K];
|
let bitstring = [true; K];
|
||||||
assert_eq!(
|
assert_eq!(i2lebsp_k(lebs2ip_k(&bitstring) as usize), bitstring);
|
||||||
i2lebsp_k(lebs2ip_k(&bitstring) as usize).to_vec(),
|
|
||||||
bitstring
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -302,11 +302,8 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn i2lebsp_round_trip() {
|
fn i2lebsp_round_trip() {
|
||||||
{
|
{
|
||||||
let bitstring = (0..64).map(|_| rand::random()).collect::<Vec<_>>();
|
let bitstring = [0; 64].map(|_| rand::random());
|
||||||
assert_eq!(
|
assert_eq!(i2lebsp(lebs2ip(&bitstring)), bitstring);
|
||||||
i2lebsp::<64>(lebs2ip::<64>(&bitstring.clone().try_into().unwrap())).to_vec(),
|
|
||||||
bitstring
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue