Skip to content

Commit

Permalink
use map_err instead of if let
Browse files Browse the repository at this point in the history
  • Loading branch information
nanashi-1 committed May 7, 2024
1 parent 59fec0d commit 3566661
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ fn main() {
context
);

if let Err(e) = list(context) {
println!("{}", e.to_string().color_as_error())
}
list(context)
.map_err(|e| e.to_string().color_as_error())
.unwrap();
}
SubCommands::Compile {
input,
Expand Down Expand Up @@ -132,9 +132,9 @@ fn main() {
context
);

if let Err(e) = compile(context) {
println!("{}", e.to_string().color_as_error())
}
compile(context)
.map_err(|e| e.to_string().color_as_error())
.unwrap();
}
}
}

0 comments on commit 3566661

Please sign in to comment.