From 1ec2220def43e37e5a65b96dde93c19b493258f4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 11 Jul 2026 16:03:05 +0900 Subject: feat(completion): thread Rc through suggest_options InputDefinition stores options as Rc for sharing, so CompletionSuggestions::suggest_option[s] now accepts Rc instead of owned values, resolving the ownership mismatch left as a todo!() in Application::complete and CompleteCommand. --- crates/shirabe/src/console/application.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'crates/shirabe/src/console') diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs index 5591c84b..86639444 100644 --- a/crates/shirabe/src/console/application.rs +++ b/crates/shirabe/src/console/application.rs @@ -718,11 +718,14 @@ impl Application { } if CompletionInput::TYPE_OPTION_NAME == input.get_completion_type() { - // $suggestions->suggestOptions($this->getDefinition()->getOptions()); - // TODO(review): get_options() yields Rc (shared, non-Clone) while - // suggest_options() consumes owned InputOption values; an ownership/clone strategy - // for InputOption is needed. - suggestions.suggest_options(todo!("owned options from get_definition().get_options()")); + let options: Vec> = self + .get_definition() + .borrow() + .get_options() + .values() + .cloned() + .collect(); + suggestions.suggest_options(options); return Ok(()); } -- cgit v1.3.1