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 f47ed75 commit 2099316
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());

Check failure on line 82 in coffee_cmd/src/main.rs

View workflow job for this annotation

GitHub Actions / Build (stable)

mismatched types

Check failure on line 82 in coffee_cmd/src/main.rs

View workflow job for this annotation

GitHub Actions / Build (beta)

mismatched types

Check failure on line 82 in coffee_cmd/src/main.rs

View workflow job for this annotation

GitHub Actions / Build (nightly)

mismatched types
return Err(err);
}
}
Expand Down

0 comments on commit 2099316

Please sign in to comment.