File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1- #![ feature( try_blocks) ]
21#![ allow( incomplete_features) ]
32#![ feature( impl_trait_in_assoc_type) ]
43
Original file line number Diff line number Diff line change @@ -19,15 +19,16 @@ fn handle_workspace_fsck(me: WorkspaceFsckAction) -> anyhow::Result<()> {
1919 let albums = workspace. scan ( ) ?;
2020 for album in albums {
2121 if let WorkspaceAlbumState :: Dangling ( album_path) = album. state {
22- let result: anyhow:: Result < ( ) > = try {
22+ let result = || -> anyhow:: Result < ( ) > {
2323 let dot_album = album_path. join ( ".album" ) ;
2424 let real_path = workspace. controlled_album_path ( & album. album_id , 2 ) ;
2525 if !real_path. exists ( ) {
2626 fs:: create_dir_all ( & real_path) ?;
2727 }
2828 fs:: remove_file ( & dot_album, false ) ?;
2929 fs:: symlink_dir ( & real_path, & dot_album) ?;
30- } ;
30+ Ok ( ( ) )
31+ } ( ) ;
3132
3233 if let Err ( e) = result {
3334 log:: error!(
@@ -44,7 +45,7 @@ fn handle_workspace_fsck(me: WorkspaceFsckAction) -> anyhow::Result<()> {
4445 let albums = workspace. scan ( ) ?;
4546 for album in albums {
4647 if let WorkspaceAlbumState :: Garbage = album. state {
47- let result: anyhow:: Result < ( ) > = try {
48+ let result = || -> anyhow:: Result < ( ) > {
4849 if let Ok ( real_path) = workspace. get_album_controlled_path ( & album. album_id ) {
4950 // 1. remove garbage album directory
5051 fs:: remove_dir_all ( & real_path, true ) ?;
@@ -63,7 +64,8 @@ fn handle_workspace_fsck(me: WorkspaceFsckAction) -> anyhow::Result<()> {
6364 }
6465 }
6566 }
66- } ;
67+ Ok ( ( ) )
68+ } ( ) ;
6769
6870 if let Err ( e) = result {
6971 log:: error!( "Error while collecting garbage: {}" , e) ;
You can’t perform that action at this time.
0 commit comments