aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index f126839..b4c7781 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -31,11 +31,8 @@ fn open_stream() -> io::Result<()> {
}
fn main() {
- match open_stream() {
- Ok(_) => {},
- Err(e) => {
- writeln!(io::stderr(), "{}", e)
- .expect("Failed printing to stderr");
- },
- }
+ open_stream().unwrap_or_else(|e| {
+ writeln!(io::stderr(), "{}", e)
+ .expect("Failed printing to stderr");
+ });
}