@@ -15,21 +15,18 @@ use run_make_support::{dynamic_lib, rustc, tmp_dir};
15
15
use std:: fs;
16
16
17
17
fn main ( ) {
18
- let mut tmp_dir_other = tmp_dir ( ) ;
19
- tmp_dir_other. push ( "other" ) ;
18
+ let tmp_dir_other = tmp_dir ( ) . join ( "other" ) ;
20
19
21
- fs:: create_dir ( tmp_dir_other. clone ( ) ) ;
20
+ fs:: create_dir ( & tmp_dir_other) ;
22
21
rustc ( ) . input ( "foo.rs" ) . crate_type ( "dylib" ) . codegen_option ( "prefer-dynamic" ) . run ( ) ;
23
- fs:: rename ( dynamic_lib ( "foo" ) , tmp_dir_other. clone ( ) ) ;
22
+ fs:: rename ( dynamic_lib ( "foo" ) , & tmp_dir_other) ;
24
23
rustc ( ) . input ( "foo.rs" ) . crate_type ( "dylib" ) . codegen_option ( "prefer-dynamic" ) . run ( ) ;
25
- rustc ( ) . input ( "bar.rs" ) . library_search_path ( tmp_dir_other. clone ( ) ) . run ( ) ;
24
+ rustc ( ) . input ( "bar.rs" ) . library_search_path ( & tmp_dir_other) . run ( ) ;
26
25
fs:: remove_dir_all ( tmp_dir ( ) ) ;
27
26
28
- fs:: create_dir_all ( tmp_dir_other. clone ( ) ) ;
27
+ fs:: create_dir_all ( & tmp_dir_other) ;
29
28
rustc ( ) . input ( "foo.rs" ) . crate_type ( "rlib" ) . run ( ) ;
30
- let mut tmp_dir_libfoo = tmp_dir ( ) ;
31
- tmp_dir_libfoo. push ( "libfoo.rlib" ) ;
32
- fs:: rename ( tmp_dir_libfoo, tmp_dir_other. clone ( ) ) ;
29
+ fs:: rename ( tmp_dir ( ) . join ( "libfoo.rlib" ) , & tmp_dir_other) ;
33
30
rustc ( ) . input ( "foo.rs" ) . crate_type ( "rlib" ) . run ( ) ;
34
- rustc ( ) . input ( "bar.rs" ) . library_search_path ( tmp_dir_other. clone ( ) ) . run ( ) ;
31
+ rustc ( ) . input ( "bar.rs" ) . library_search_path ( tmp_dir_other) . run ( ) ;
35
32
}
0 commit comments