@@ -3,23 +3,23 @@ use std::path::PathBuf;
3
3
4
4
// Paths are written as a string in the UNIX format to make it easy
5
5
// 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" ) ,
23
23
] ;
24
24
25
25
fn repath ( origin : & str ) -> String {
@@ -30,15 +30,15 @@ fn repath(origin: &str) -> String {
30
30
repathed. into_os_string ( ) . into_string ( ) . unwrap ( )
31
31
}
32
32
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 ) ) )
35
35
}
36
36
37
37
pub fn unique_paths ( ) -> impl Iterator < Item = String > {
38
38
// Hashset used to test uniqueness of values through insert method.
39
39
let mut unique_paths = HashSet :: new ( ) ;
40
40
TEST_CASES
41
41
. 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 ) )
44
44
}
0 commit comments