File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -147,13 +147,11 @@ impl LocalAsset {
147147 details,
148148 } ) ;
149149 }
150- } else {
151- if let Err ( details) = fs:: remove_file ( & dest_path) {
152- return Err ( AxoassetError :: LocalAssetRemoveFailed {
153- dest_path : dest_path. display ( ) . to_string ( ) ,
154- details,
155- } ) ;
156- }
150+ } else if let Err ( details) = fs:: remove_file ( & dest_path) {
151+ return Err ( AxoassetError :: LocalAssetRemoveFailed {
152+ dest_path : dest_path. display ( ) . to_string ( ) ,
153+ details,
154+ } ) ;
157155 }
158156
159157 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ fn it_removes_both_file_and_directory() {
77 let file_path = Path :: new ( & dest. as_os_str ( ) ) . join ( "subdir" ) . join ( "test.md" ) ;
88 let dir_path = Path :: new ( & dest. as_os_str ( ) ) . join ( "subdir" ) ;
99
10- fs:: create_dir_all ( & file_path. parent ( ) . unwrap ( ) ) ;
10+ fs:: create_dir_all ( & file_path. parent ( ) . unwrap ( ) ) . unwrap ( ) ;
1111 fs:: write ( & file_path, "hello" ) . unwrap ( ) ;
1212
13- axoasset:: LocalAsset :: remove ( & file_path. display ( ) . to_string ( ) ) ;
13+ axoasset:: LocalAsset :: remove ( & file_path. display ( ) . to_string ( ) ) . unwrap ( ) ;
1414 assert ! ( !file_path. exists( ) ) ;
1515
16- axoasset:: LocalAsset :: remove ( & dir_path. display ( ) . to_string ( ) ) ;
16+ axoasset:: LocalAsset :: remove ( & dir_path. display ( ) . to_string ( ) ) . unwrap ( ) ;
1717 assert ! ( !dir_path. exists( ) ) ;
1818}
You can’t perform that action at this time.
0 commit comments