@@ -14,22 +14,17 @@ use regex::Regex;
14
14
///
15
15
/// This function is designed to avoid file duplications. It is using rustc version string
16
16
/// to rename common files (css files, jquery.js, playpen.js, main.js etc.) in a standard rustdoc.
17
- pub fn copy_doc_dir < P : AsRef < Path > > ( target : P ,
18
- destination : P ,
19
- rustc_version : & str )
20
- -> Result < ( ) > {
17
+ pub fn copy_doc_dir < P : AsRef < Path > > ( target : P , destination : P ) -> Result < ( ) > {
21
18
let source = PathBuf :: from ( target. as_ref ( ) ) . join ( "doc" ) ;
22
19
copy_files_and_handle_html ( source,
23
20
destination. as_ref ( ) . to_path_buf ( ) ,
24
- true ,
25
- rustc_version)
21
+ true )
26
22
}
27
23
28
24
29
25
fn copy_files_and_handle_html ( source : PathBuf ,
30
26
destination : PathBuf ,
31
- handle_html : bool ,
32
- rustc_version : & str )
27
+ handle_html : bool )
33
28
-> Result < ( ) > {
34
29
35
30
// FIXME: handle_html is useless since we started using --resource-suffix
@@ -57,8 +52,7 @@ fn copy_files_and_handle_html(source: PathBuf,
57
52
fs:: create_dir_all ( & destination_full_path) ?;
58
53
copy_files_and_handle_html ( file. path ( ) ,
59
54
destination_full_path,
60
- handle_html,
61
- & rustc_version) ?
55
+ handle_html) ?
62
56
} else if handle_html && dup_regex. is_match ( & file. file_name ( ) . into_string ( ) . unwrap ( ) [ ..] ) {
63
57
continue ;
64
58
} else {
@@ -84,7 +78,7 @@ mod test {
84
78
let destination = tempdir:: TempDir :: new ( "cratesfyi" ) . unwrap ( ) ;
85
79
86
80
// lets try to copy a src directory to tempdir
87
- let res = copy_dir ( Path :: new ( "src" ) , destination. path ( ) ) ;
81
+ let res = copy_doc_dir ( Path :: new ( "src" ) , destination. path ( ) ) ;
88
82
// remove temp dir
89
83
fs:: remove_dir_all ( destination. path ( ) ) . unwrap ( ) ;
90
84
0 commit comments