File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -355,8 +355,13 @@ pub fn registry_strategy(
355
355
) -> impl Strategy < Value = PrettyPrintRegistry > {
356
356
let name = string_regex ( "[A-Za-z][A-Za-z0-9_-]*(-sys)?" ) . unwrap ( ) ;
357
357
358
- let raw_version = [ ..max_versions; 3 ] ;
359
- let version_from_raw = |v : & [ usize ; 3 ] | format ! ( "{}.{}.{}" , v[ 0 ] , v[ 1 ] , v[ 2 ] ) ;
358
+ let raw_version = ..max_versions. pow ( 3 ) ;
359
+ let version_from_raw = move |r : usize | {
360
+ let major = ( ( r / max_versions) / max_versions) % max_versions;
361
+ let minor = ( r / max_versions) % max_versions;
362
+ let patch = r % max_versions;
363
+ format ! ( "{}.{}.{}" , major, minor, patch)
364
+ } ;
360
365
361
366
// If this is false than the crate will depend on the nonexistent "bad"
362
367
// instead of the complex set we generated for it.
@@ -365,7 +370,7 @@ pub fn registry_strategy(
365
370
let list_of_versions =
366
371
btree_map ( raw_version, allow_deps, 1 ..=max_versions) . prop_map ( move |ver| {
367
372
ver. into_iter ( )
368
- . map ( |a| ( version_from_raw ( & a. 0 ) , a. 1 ) )
373
+ . map ( |a| ( version_from_raw ( a. 0 ) , a. 1 ) )
369
374
. collect :: < Vec < _ > > ( )
370
375
} ) ;
371
376
You can’t perform that action at this time.
0 commit comments