From e1c444021bdc7fda4e6552264fa5e246516d97fe Mon Sep 17 00:00:00 2001 From: royalpinto007 Date: Sat, 30 Dec 2023 22:02:43 +0530 Subject: [PATCH] fix: minor bugs/comments --- coffee_cmd/src/main.rs | 8 ++------ coffee_core/src/coffee.rs | 1 - coffee_lib/src/plugin.rs | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/coffee_cmd/src/main.rs b/coffee_cmd/src/main.rs index 4e8e3e6..d8dff96 100644 --- a/coffee_cmd/src/main.rs +++ b/coffee_cmd/src/main.rs @@ -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.and_then(|splinner| Some(splinner.finish())); match res.status { UpgradeStatus::UpToDate => { term::info!("Remote repository `{}` is already up to date!", res.repo) @@ -81,9 +79,7 @@ async fn main() -> Result<(), CoffeeError> { } } Err(err) => { - if let Some(spinner) = spinner { - spinner.failed(); - } + spinner.and_then(|spinner| Some(spinner.failed())); return Err(err); } } diff --git a/coffee_core/src/coffee.rs b/coffee_core/src/coffee.rs index c52d61a..fbaef74 100644 --- a/coffee_core/src/coffee.rs +++ b/coffee_core/src/coffee.rs @@ -345,7 +345,6 @@ impl PluginManager for CoffeeManager { let status = repository.upgrade(&self.config.plugins).await?; for plugins in status.plugins_effected.iter() { self.remove(plugins).await?; - // FIXME: pass the verbose flag to the upgrade command self.install(plugins, verbose, false).await?; } self.flush().await?; diff --git a/coffee_lib/src/plugin.rs b/coffee_lib/src/plugin.rs index 38435f1..a8f2f40 100644 --- a/coffee_lib/src/plugin.rs +++ b/coffee_lib/src/plugin.rs @@ -149,7 +149,7 @@ impl Plugin { } /// upgrade the plugin to a new version. - pub async fn upgrade(&mut self, verbose: bool) -> Result<(), CoffeeError> { + pub async fn upgrade(&mut self, _: bool) -> Result<(), CoffeeError> { todo!("not implemented yet") }