File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use rand::{
77use crate :: MultihashGeneric ;
88
99/// Generates a random valid multihash.
10- impl Arbitrary for MultihashGeneric < 64 > {
10+ impl < const S : usize > Arbitrary for MultihashGeneric < S > {
1111 fn arbitrary < G : Gen > ( g : & mut G ) -> Self {
1212 // In real world lower multihash codes are more likely to happen, hence distribute them
1313 // with bias towards smaller values.
@@ -25,9 +25,9 @@ impl Arbitrary for MultihashGeneric<64> {
2525 _ => unreachable ! ( ) ,
2626 } ;
2727
28- // Maximum size is 64 byte due to the `U64` generic
29- let size = g. gen_range ( 0 , 64 ) ;
30- let mut data = [ 0 ; 64 ] ;
28+ // Maximum size is S byte due to the generic.
29+ let size = g. gen_range ( 0 , S ) ;
30+ let mut data = [ 0 ; S ] ;
3131 g. fill_bytes ( & mut data) ;
3232 MultihashGeneric :: wrap ( code, & data[ ..size] ) . unwrap ( )
3333 }
You can’t perform that action at this time.
0 commit comments