@@ -318,7 +318,7 @@ pub fn read_dir_if_exists<P: AsRef<AbsNormPath>>(path: P) -> Result<Option<ReadD
318318pub fn try_exists < P : AsRef < AbsPath > > ( path : P ) -> Result < bool , IoError > {
319319 let _guard = IoCounterKey :: Stat . guard ( ) ;
320320 make_error ! (
321- fs :: try_exists ( path. as_ref( ) . as_maybe_relativized( ) ) ,
321+ path. as_ref( ) . as_maybe_relativized( ) . try_exists ( ) ,
322322 format!( "try_exists({})" , P :: as_ref( & path) . display( ) )
323323 )
324324}
@@ -1060,7 +1060,7 @@ mod tests {
10601060 let dir_path = root. join ( "dir" ) ;
10611061 create_dir_all ( AbsPath :: new ( & dir_path) ?) ?;
10621062 assert_matches ! ( remove_file( & dir_path) , Err ( ..) ) ;
1063- assert ! ( fs :: try_exists( & dir_path ) ?) ;
1063+ assert ! ( dir_path . try_exists( ) ?) ;
10641064 Ok ( ( ) )
10651065 }
10661066
@@ -1102,7 +1102,7 @@ mod tests {
11021102 let path = root. join ( "file" ) ;
11031103 fs:: write ( & path, b"regular" ) ?;
11041104 remove_all ( & path) ?;
1105- assert ! ( !fs :: try_exists( & path ) ?) ;
1105+ assert ! ( !path . try_exists( ) ?) ;
11061106 Ok ( ( ) )
11071107 }
11081108
@@ -1114,7 +1114,7 @@ mod tests {
11141114 fs:: create_dir ( & path) ?;
11151115 fs:: write ( path. join ( "file" ) , b"regular file in a dir" ) ?;
11161116 remove_all ( & path) ?;
1117- assert ! ( !fs :: try_exists( & path ) ?) ;
1117+ assert ! ( !path . try_exists( ) ?) ;
11181118 Ok ( ( ) )
11191119 }
11201120
@@ -1163,7 +1163,7 @@ mod tests {
11631163 let file_path = root. join ( "file" ) ;
11641164 fs:: write ( & file_path, b"File content" ) ?;
11651165 assert ! ( remove_dir_all( & file_path) . is_err( ) ) ;
1166- assert ! ( fs :: try_exists( & file_path ) ?) ;
1166+ assert ! ( file_path . try_exists( ) ?) ;
11671167 Ok ( ( ) )
11681168 }
11691169
0 commit comments