14
14
//! not a lot of interesting happenings here unfortunately.
15
15
16
16
use std:: env;
17
- use std:: ffi:: OsString ;
18
17
use std:: fs;
19
18
use std:: io:: { self , Write } ;
20
19
use std:: path:: { Path , PathBuf } ;
@@ -32,16 +31,9 @@ pub fn staticlib(name: &str, target: &str) -> String {
32
31
}
33
32
}
34
33
35
- /// Copies a file from `src` to `dst`, attempting to use hard links and then
36
- /// falling back to an actually filesystem copy if necessary.
34
+ /// Copies a file from `src` to `dst`
37
35
pub fn copy ( src : & Path , dst : & Path ) {
38
- // A call to `hard_link` will fail if `dst` exists, so remove it if it
39
- // already exists so we can try to help `hard_link` succeed.
40
36
let _ = fs:: remove_file ( & dst) ;
41
-
42
- // Attempt to "easy copy" by creating a hard link (symlinks don't work on
43
- // windows), but if that fails just fall back to a slow `copy` operation.
44
- // let res = fs::hard_link(src, dst);
45
37
let res = fs:: copy ( src, dst) ;
46
38
if let Err ( e) = res {
47
39
panic ! ( "failed to copy `{}` to `{}`: {}" , src. display( ) ,
@@ -149,8 +141,7 @@ pub fn dylib_path_var() -> &'static str {
149
141
/// Parses the `dylib_path_var()` environment variable, returning a list of
150
142
/// paths that are members of this lookup path.
151
143
pub fn dylib_path ( ) -> Vec < PathBuf > {
152
- env:: split_paths ( & env:: var_os ( dylib_path_var ( ) ) . unwrap_or ( OsString :: new ( ) ) )
153
- . collect ( )
144
+ env:: split_paths ( & env:: var_os ( dylib_path_var ( ) ) . unwrap_or_default ( ) ) . collect ( )
154
145
}
155
146
156
147
/// `push` all components to `buf`. On windows, append `.exe` to the last component.
@@ -422,4 +413,4 @@ impl CiEnv {
422
413
cmd. env ( "TERM" , "xterm" ) . args ( & [ "--color" , "always" ] ) ;
423
414
}
424
415
}
425
- }
416
+ }
0 commit comments