From 243450fee9853c2fea66ae0642dabb8db5227d6f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 8 Jun 2026 02:44:38 +0900 Subject: feat(phase-c): resolve closure-capture phase-b TODOs in config/create-project Port Config::process() to the real Preg::replace_callback, whose closure borrows &self/flags and calls get_with_flags; surface get() errors via a captured cell so process now returns Result. Switch the replace_callback shim bounds to FnMut to allow the error-capturing closure. Wire CreateProjectCommand suggestion collection through the Rc reporter's interior mutation. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/command/create_project_command.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/src/command') diff --git a/crates/shirabe/src/command/create_project_command.rs b/crates/shirabe/src/command/create_project_command.rs index 77cbea7..f8fc511 100644 --- a/crates/shirabe/src/command/create_project_command.rs +++ b/crates/shirabe/src/command/create_project_command.rs @@ -972,8 +972,11 @@ impl CreateProjectCommand { im.notify_installs(io.clone()); // collect suggestions - // TODO(phase-b): self.suggested_packages_reporter is on the outer scope via &self - // self.suggested_packages_reporter.add_suggestions_from_package(&*package); + self.suggested_packages_reporter + .as_ref() + .unwrap() + .borrow_mut() + .add_suggestions_from_package(package.clone()); let installed_from_vcs = package.get_installation_source().as_deref() == Some("source"); -- cgit v1.3.1