diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-25 00:58:20 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-25 00:58:36 +0900 |
| commit | 1921f173ea219cb4b25847294d2d3fa465550fbb (patch) | |
| tree | 0d30486a2cb9a0c106e5d5827be3f655c60cd871 /crates/shirabe/src/command/bump_command.rs | |
| parent | dbdecaf5a1c54a876b7ee0153d58dd39b1080f97 (diff) | |
| download | php-shirabe-1921f173ea219cb4b25847294d2d3fa465550fbb.tar.gz php-shirabe-1921f173ea219cb4b25847294d2d3fa465550fbb.tar.zst php-shirabe-1921f173ea219cb4b25847294d2d3fa465550fbb.zip | |
refactor(package): introduce Rc<RefCell<_>> handles for packages
PHP packages have reference semantics, so introduce shared-ownership
handles over an AnyPackage enum (PackageInterfaceHandle and friends)
and replace Box<dyn PackageInterface> throughout.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/bump_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/bump_command.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/shirabe/src/command/bump_command.rs b/crates/shirabe/src/command/bump_command.rs index 0b9727f..3299f85 100644 --- a/crates/shirabe/src/command/bump_command.rs +++ b/crates/shirabe/src/command/bump_command.rs @@ -251,13 +251,14 @@ impl BumpCommand { None => continue, Some(p) => p, }; - while let Some(alias) = package.as_any().downcast_ref::<AliasPackage>() { - // TODO(phase-b): get_alias_of returns &dyn BasePackage; cloning into Box - // requires clone_box on BasePackage applied to a borrowed ref. - package = alias.get_alias_of().clone_box(); + while let Some(alias) = package.as_alias() { + package = alias.get_alias_of().into(); } - let bumped = bumper.bump_requirement(link.get_constraint(), package.as_ref())?; + let bumped = bumper.bump_requirement( + link.get_constraint(), + package.as_rc().borrow().as_package_interface(), + )?; if bumped == current_constraint { continue; |
