We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 217a0c8 commit 744947cCopy full SHA for 744947c
examples/write_dir.rs
@@ -30,11 +30,7 @@ enum CompressionMethod {
30
Zstd,
31
}
32
33
-fn main() {
34
- std::process::exit(real_main());
35
-}
36
-
37
-fn real_main() -> i32 {
+fn main() -> ! {
38
let args = Args::parse();
39
let src_dir = &args.source;
40
let dst_file = &args.destination;
@@ -70,11 +66,15 @@ fn real_main() -> i32 {
70
66
},
71
67
};
72
68
match doit(src_dir, dst_file, method) {
73
- Ok(_) => println!("done: {src_dir:?} written to {dst_file:?}"),
74
- Err(e) => eprintln!("Error: {e:?}"),
69
+ Ok(_) => {
+ println!("done: {src_dir:?} written to {dst_file:?}");
+ std::process::exit(0);
+ }
+ Err(e) => {
+ eprintln!("Error: {e:?}");
75
+ std::process::abort();
76
77
- 0
78
79
80
fn zip_dir<T>(
0 commit comments