File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -509,7 +509,7 @@ fn package_symlink_to_submodule() {
509
509
#[ cfg( unix) ]
510
510
use std:: os:: unix:: fs:: symlink as symlink;
511
511
#[ cfg( windows) ]
512
- use std:: os:: unix :: fs:: symlink_dir as symlink;
512
+ use std:: os:: windows :: fs:: symlink_dir as symlink;
513
513
514
514
let project = git:: new ( "foo" , |project| {
515
515
project
@@ -697,9 +697,11 @@ See [..]
697
697
}
698
698
699
699
#[ cargo_test]
700
- #[ cfg( unix) ]
701
700
fn broken_symlink ( ) {
702
- use std:: os:: unix:: fs;
701
+ #[ cfg( unix) ]
702
+ use std:: os:: unix:: fs:: symlink as symlink;
703
+ #[ cfg( windows) ]
704
+ use std:: os:: windows:: fs:: symlink_dir as symlink;
703
705
704
706
let p = project ( )
705
707
. file (
@@ -718,7 +720,7 @@ fn broken_symlink() {
718
720
)
719
721
. file ( "src/main.rs" , r#"fn main() { println!("hello"); }"# )
720
722
. build ( ) ;
721
- t ! ( fs :: symlink( "nowhere" , & p. root( ) . join( "src/foo.rs" ) ) ) ;
723
+ t ! ( symlink( "nowhere" , & p. root( ) . join( "src/foo.rs" ) ) ) ;
722
724
723
725
p. cargo ( "package -v" )
724
726
. with_status ( 101 )
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ impl SymlinkBuilder {
200
200
fn mk ( & self ) {
201
201
self . dirname ( ) . mkdir_p ( ) ;
202
202
if self . src_is_dir {
203
- t ! ( os:: window :: fs:: symlink_dir( & self . dst, & self . src) ) ;
203
+ t ! ( os:: windows :: fs:: symlink_dir( & self . dst, & self . src) ) ;
204
204
} else {
205
205
t ! ( os:: windows:: fs:: symlink_file( & self . dst, & self . src) ) ;
206
206
}
@@ -261,7 +261,7 @@ impl ProjectBuilder {
261
261
. push ( FileBuilder :: new ( self . root . root ( ) . join ( path) , body) ) ;
262
262
}
263
263
264
- /// Adds a symlink to the project.
264
+ /// Adds a symlink to a file to the project.
265
265
pub fn symlink < T : AsRef < Path > > ( mut self , dst : T , src : T ) -> Self {
266
266
self . symlinks . push ( SymlinkBuilder :: new (
267
267
self . root . root ( ) . join ( dst) ,
@@ -270,6 +270,7 @@ impl ProjectBuilder {
270
270
self
271
271
}
272
272
273
+ /// Create a symlink to a directory
273
274
pub fn symlink_dir < T : AsRef < Path > > ( mut self , dst : T , src : T ) -> Self {
274
275
self . symlinks . push ( SymlinkBuilder :: new_dir (
275
276
self . root . root ( ) . join ( dst) ,
You can’t perform that action at this time.
0 commit comments