@@ -106,8 +106,8 @@ impl FileIO {
106106 /// - If the path is a file or not exist, this function will be no-op.
107107 /// - If the path is a empty directory, this function will remove the directory itself.
108108 /// - If the path is a non-empty directory, this function will remove the directory and all nested files and directories.
109- pub async fn remove_dir_all ( & self , path : impl AsRef < str > ) -> Result < ( ) > {
110- self . inner . remove_dir_all ( path. as_ref ( ) ) . await
109+ pub async fn delete_prefix ( & self , path : impl AsRef < str > ) -> Result < ( ) > {
110+ self . inner . delete_prefix ( path. as_ref ( ) ) . await
111111 }
112112
113113 /// Check file exists.
@@ -594,7 +594,7 @@ mod tests {
594594 Ok ( ( ) )
595595 }
596596
597- async fn remove_dir_all ( & self , _path : & str ) -> Result < ( ) > {
597+ async fn delete_prefix ( & self , _path : & str ) -> Result < ( ) > {
598598 Ok ( ( ) )
599599 }
600600
@@ -692,14 +692,14 @@ mod tests {
692692 assert ! ( file_io. exists( & a_path) . await . unwrap( ) ) ;
693693
694694 // Remove a file should be no-op.
695- file_io. remove_dir_all ( & a_path) . await . unwrap ( ) ;
695+ file_io. delete_prefix ( & a_path) . await . unwrap ( ) ;
696696 assert ! ( file_io. exists( & a_path) . await . unwrap( ) ) ;
697697
698698 // Remove a not exist dir should be no-op.
699- file_io. remove_dir_all ( "not_exists/" ) . await . unwrap ( ) ;
699+ file_io. delete_prefix ( "not_exists/" ) . await . unwrap ( ) ;
700700
701701 // Remove a dir should remove all files in it.
702- file_io. remove_dir_all ( & sub_dir_path) . await . unwrap ( ) ;
702+ file_io. delete_prefix ( & sub_dir_path) . await . unwrap ( ) ;
703703 assert ! ( !file_io. exists( & b_path) . await . unwrap( ) ) ;
704704 assert ! ( !file_io. exists( & c_path) . await . unwrap( ) ) ;
705705 assert ! ( file_io. exists( & a_path) . await . unwrap( ) ) ;
@@ -718,7 +718,7 @@ mod tests {
718718 let file_io = create_local_file_io ( ) ;
719719 assert ! ( !file_io. exists( & full_path) . await . unwrap( ) ) ;
720720 assert ! ( file_io. delete( & full_path) . await . is_ok( ) ) ;
721- assert ! ( file_io. remove_dir_all ( & full_path) . await . is_ok( ) ) ;
721+ assert ! ( file_io. delete_prefix ( & full_path) . await . is_ok( ) ) ;
722722 }
723723
724724 #[ tokio:: test]
0 commit comments