diff options
Diffstat (limited to 'crates/shirabe/src/command/search_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/search_command.rs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/crates/shirabe/src/command/search_command.rs b/crates/shirabe/src/command/search_command.rs index 2033cfc..5d6a31b 100644 --- a/crates/shirabe/src/command/search_command.rs +++ b/crates/shirabe/src/command/search_command.rs @@ -10,6 +10,7 @@ use crate::plugin::CommandEvent; use crate::plugin::PluginEvents; use crate::repository::CompositeRepository; use crate::repository::PlatformRepository; +use crate::repository::RepositoryInterfaceHandle; use crate::repository::repository_interface::{self, RepositoryInterface}; use anyhow::Result; use indexmap::IndexMap; @@ -78,18 +79,22 @@ impl SearchCommand { self.create_composer_instance(input, io_box, None, false, None)? }; let composer_ref = crate::command::composer_full(&composer); - // TODO(phase-b): get_local_repository returns &dyn InstalledRepositoryInterface but we need Box<dyn RepositoryInterface> - let local_repo: Box<dyn RepositoryInterface> = - todo!("share local_repo as RepositoryInterface"); - let installed_repo = CompositeRepository::new(vec![local_repo, Box::new(platform_repo)]); - let mut all_repos: Vec<Box<dyn RepositoryInterface>> = vec![Box::new(installed_repo)]; - // TODO(phase-b): get_repositories returns &Vec<Box<...>>; needs ownership reshape + let local_repo = composer_ref + .get_repository_manager() + .borrow() + .get_local_repository(); + let installed_repo = CompositeRepository::new(vec![ + local_repo, + RepositoryInterfaceHandle::new(platform_repo), + ]); + let mut all_repos: Vec<RepositoryInterfaceHandle> = + vec![RepositoryInterfaceHandle::new(installed_repo)]; for r in composer_ref .get_repository_manager() .borrow() .get_repositories() { - all_repos.push(r.clone_box()); + all_repos.push(r.clone()); } let repos = CompositeRepository::new(all_repos); |
