@@ -6,9 +6,9 @@ pub struct PathFixture(PathFixtureInner);
66enum PathFixtureInner {
77 None ,
88 Immutable ( std:: path:: PathBuf ) ,
9- #[ cfg( feature = "path " ) ]
9+ #[ cfg( feature = "dir " ) ]
1010 MutablePath ( std:: path:: PathBuf ) ,
11- #[ cfg( feature = "path " ) ]
11+ #[ cfg( feature = "dir " ) ]
1212 MutableTemp {
1313 temp : tempfile:: TempDir ,
1414 path : std:: path:: PathBuf ,
@@ -24,7 +24,7 @@ impl PathFixture {
2424 Self ( PathFixtureInner :: Immutable ( target. to_owned ( ) ) )
2525 }
2626
27- #[ cfg( feature = "path " ) ]
27+ #[ cfg( feature = "dir " ) ]
2828 pub fn mutable_temp ( ) -> Result < Self , crate :: assert:: Error > {
2929 let temp = tempfile:: tempdir ( ) . map_err ( |e| e. to_string ( ) ) ?;
3030 // We need to get the `/private` prefix on Mac so variable substitutions work
@@ -34,15 +34,15 @@ impl PathFixture {
3434 Ok ( Self ( PathFixtureInner :: MutableTemp { temp, path } ) )
3535 }
3636
37- #[ cfg( feature = "path " ) ]
37+ #[ cfg( feature = "dir " ) ]
3838 pub fn mutable_at ( target : & std:: path:: Path ) -> Result < Self , crate :: assert:: Error > {
3939 let _ = std:: fs:: remove_dir_all ( target) ;
4040 std:: fs:: create_dir_all ( target)
4141 . map_err ( |e| format ! ( "Failed to create {}: {}" , target. display( ) , e) ) ?;
4242 Ok ( Self ( PathFixtureInner :: MutablePath ( target. to_owned ( ) ) ) )
4343 }
4444
45- #[ cfg( feature = "path " ) ]
45+ #[ cfg( feature = "dir " ) ]
4646 pub fn with_template (
4747 self ,
4848 template_root : & std:: path:: Path ,
@@ -67,9 +67,9 @@ impl PathFixture {
6767 pub fn is_mutable ( & self ) -> bool {
6868 match & self . 0 {
6969 PathFixtureInner :: None | PathFixtureInner :: Immutable ( _) => false ,
70- #[ cfg( feature = "path " ) ]
70+ #[ cfg( feature = "dir " ) ]
7171 PathFixtureInner :: MutablePath ( _) => true ,
72- #[ cfg( feature = "path " ) ]
72+ #[ cfg( feature = "dir " ) ]
7373 PathFixtureInner :: MutableTemp { .. } => true ,
7474 }
7575 }
@@ -78,9 +78,9 @@ impl PathFixture {
7878 match & self . 0 {
7979 PathFixtureInner :: None => None ,
8080 PathFixtureInner :: Immutable ( path) => Some ( path. as_path ( ) ) ,
81- #[ cfg( feature = "path " ) ]
81+ #[ cfg( feature = "dir " ) ]
8282 PathFixtureInner :: MutablePath ( path) => Some ( path. as_path ( ) ) ,
83- #[ cfg( feature = "path " ) ]
83+ #[ cfg( feature = "dir " ) ]
8484 PathFixtureInner :: MutableTemp { path, .. } => Some ( path. as_path ( ) ) ,
8585 }
8686 }
@@ -89,9 +89,9 @@ impl PathFixture {
8989 pub fn close ( self ) -> Result < ( ) , std:: io:: Error > {
9090 match self . 0 {
9191 PathFixtureInner :: None | PathFixtureInner :: Immutable ( _) => Ok ( ( ) ) ,
92- #[ cfg( feature = "path " ) ]
92+ #[ cfg( feature = "dir " ) ]
9393 PathFixtureInner :: MutablePath ( _) => Ok ( ( ) ) ,
94- #[ cfg( feature = "path " ) ]
94+ #[ cfg( feature = "dir " ) ]
9595 PathFixtureInner :: MutableTemp { temp, .. } => temp. close ( ) ,
9696 }
9797 }
0 commit comments