diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-03-23 20:45:45 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-03-23 20:45:45 +0200 |
commit | 96985e40a28f1176b383ada285ac7082133633c4 (patch) | |
tree | 1db7168fb2a9984a0b31847a70e63c30a0968dde | |
parent | 9b13b275f2615be492ab0098f34f5c65b6b193ca (diff) | |
download | checksums-hands-on-manyfiles.tar.gz |
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | src/main.rs | 6 |
2 files changed, 5 insertions, 2 deletions
@@ -6,5 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +anyhow = "1.0.70" clap = { version = "4.1.12", features = ["derive"] } sha2 = "0.10.2" diff --git a/src/main.rs b/src/main.rs index 90bcf8f..b1d967c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ use clap::Parser; use std::path::PathBuf; use std::thread::spawn; -fn main() { +fn main() -> anyhow::Result<()> { let args = Args::parse(); let mut handles = vec![]; @@ -14,9 +14,11 @@ fn main() { for handle in handles { let sumresult = handle.join().expect("thread join"); - let sum = sumresult.expect("sumresult"); + let sum = sumresult?; sum.print(); } + + Ok(()) } #[derive(Parser)] |