diff --git a/coffee_core/src/coffee.rs b/coffee_core/src/coffee.rs index 958aa7b..22e62f4 100644 --- a/coffee_core/src/coffee.rs +++ b/coffee_core/src/coffee.rs @@ -575,18 +575,18 @@ impl PluginManager for CoffeeManager { } Defect::CoffeeGlobalRepoCleanup(networks) => { - for network in networks { + let iter = self + .repos + .iter() + .map(|(name, repo)| (name.to_owned(), repo.url())) + .collect::>(); + for (network, _) in networks { log::debug!("reindexing repository for the network `{:?}`", network); - let iter = self - .repos - .iter() - .map(|(name, repo)| (name.to_owned(), repo.url())) - .collect::>(); - for (name, url) in iter { + for (name, url) in &iter { self.add_remote(&name, &url.url_string, true).await?; } nurse_actions - .push(NurseStatus::MovingGlobalRepostoryTo(network.1.to_owned())); + .push(NurseStatus::MovingGlobalRepostoryTo(network.to_owned())); } let global_repo = format!("{}/repositories", self.config.root_path); rm_dir_if_exist(&global_repo).await?;