Skip to content

Commit

Permalink
fix: using map instead of if let
Browse files Browse the repository at this point in the history
  • Loading branch information
royalpinto007 committed Dec 30, 2023
1 parent a14cc48 commit 81e44c6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions coffee_cmd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ async fn main() -> Result<(), CoffeeError> {
};
match coffee.upgrade(&repo, verbose).await {
Ok(res) => {
if let Some(spinner) = spinner {
spinner.finish();
}
spinner.map(|s| s.finish());
match res.status {
UpgradeStatus::UpToDate => {
term::info!("Remote repository `{}` is already up to date!", res.repo)
Expand All @@ -81,9 +79,7 @@ async fn main() -> Result<(), CoffeeError> {
}
}
Err(err) => {
if let Some(spinner) = spinner {
spinner.failed();
}
spinner.and_then(|spinner| spinner.failed());
return Err(err);
}
}
Expand Down

0 comments on commit 81e44c6

Please sign in to comment.