@@ -3,23 +3,23 @@ use std::path::PathBuf;
33
44// Paths are written as a string in the UNIX format to make it easy
55// to maintain.
6- static TEST_CASES : & [ & [ & str ] ] = & [
7- & [ "core" , "core/index.html" ] ,
8- & [ "core::arch" , "core/arch/index.html" ] ,
9- & [ "fn" , "std/keyword.fn.html" ] ,
10- & [ "keyword:fn" , "std/keyword.fn.html" ] ,
11- & [ "primitive:fn" , "std/primitive.fn.html" ] ,
12- & [ "macro:file!" , "std/macro.file!.html" ] ,
13- & [ "macro:file" , "std/macro.file.html" ] ,
14- & [ "std::fs" , "std/fs/index.html" ] ,
15- & [ "std::fs::read_dir" , "std/fs/fn.read_dir.html" ] ,
16- & [ "std::io::Bytes" , "std/io/struct.Bytes.html" ] ,
17- & [ "std::iter::Sum" , "std/iter/trait.Sum.html" ] ,
18- & [ "std::io::error::Result" , "std/io/error/type.Result.html" ] ,
19- & [ "usize" , "std/primitive.usize.html" ] ,
20- & [ "eprintln" , "std/macro.eprintln.html" ] ,
21- & [ "alloc::format" , "alloc/macro.format.html" ] ,
22- & [ "std::mem::MaybeUninit" , "std/mem/union.MaybeUninit.html" ] ,
6+ static TEST_CASES : & [ ( & [ & str ] , & str ) ] = & [
7+ ( & [ "core" ] , "core/index.html" ) ,
8+ ( & [ "core::arch" ] , "core/arch/index.html" ) ,
9+ ( & [ "fn" ] , "std/keyword.fn.html" ) ,
10+ ( & [ "keyword:fn" ] , "std/keyword.fn.html" ) ,
11+ ( & [ "primitive:fn" ] , "std/primitive.fn.html" ) ,
12+ ( & [ "macro:file!" ] , "std/macro.file!.html" ) ,
13+ ( & [ "macro:file" ] , "std/macro.file.html" ) ,
14+ ( & [ "std::fs" ] , "std/fs/index.html" ) ,
15+ ( & [ "std::fs::read_dir" ] , "std/fs/fn.read_dir.html" ) ,
16+ ( & [ "std::io::Bytes" ] , "std/io/struct.Bytes.html" ) ,
17+ ( & [ "std::iter::Sum" ] , "std/iter/trait.Sum.html" ) ,
18+ ( & [ "std::io::error::Result" ] , "std/io/error/type.Result.html" ) ,
19+ ( & [ "usize" ] , "std/primitive.usize.html" ) ,
20+ ( & [ "eprintln" ] , "std/macro.eprintln.html" ) ,
21+ ( & [ "alloc::format" ] , "alloc/macro.format.html" ) ,
22+ ( & [ "std::mem::MaybeUninit" ] , "std/mem/union.MaybeUninit.html" ) ,
2323] ;
2424
2525fn repath ( origin : & str ) -> String {
@@ -30,15 +30,15 @@ fn repath(origin: &str) -> String {
3030 repathed. into_os_string ( ) . into_string ( ) . unwrap ( )
3131}
3232
33- pub fn test_cases < ' a > ( ) -> impl Iterator < Item = ( & ' a str , String ) > {
34- TEST_CASES . iter ( ) . map ( |x | ( x [ 0 ] , repath ( x [ 1 ] ) ) )
33+ pub fn test_cases < ' a > ( ) -> impl Iterator < Item = ( & ' a [ & ' a str ] , String ) > {
34+ TEST_CASES . iter ( ) . map ( |( args , path ) | ( * args , repath ( path ) ) )
3535}
3636
3737pub fn unique_paths ( ) -> impl Iterator < Item = String > {
3838 // Hashset used to test uniqueness of values through insert method.
3939 let mut unique_paths = HashSet :: new ( ) ;
4040 TEST_CASES
4141 . iter ( )
42- . filter ( move |e | unique_paths. insert ( e [ 1 ] ) )
43- . map ( |e | repath ( e [ 1 ] ) )
42+ . filter ( move |( _ , p ) | unique_paths. insert ( p ) )
43+ . map ( |( _ , p ) | repath ( p ) )
4444}
0 commit comments