Skip to content

Commit

Permalink
change defer statments
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNineteen committed May 30, 2024
1 parent 9d80e14 commit f54efc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/accountsdb/download.zig
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,14 @@ pub fn downloadFile(
download_size,
min_mb_per_second,
);
defer download_progress.deinit();
errdefer {
// NOTE: this shouldnt fail because we open the dir in DownloadProgress.init
const output_dir = std.fs.cwd().openDir(output_dir_str, .{}) catch {
std.debug.panic("failed to open output dir: {s}", .{output_dir_str});
};
output_dir.deleteFile(filename) catch {};
}
defer download_progress.deinit();

try setNoBody(easy, false); // full download
try easy.setUrl(url);
Expand Down

0 comments on commit f54efc9

Please sign in to comment.