From f33487739aa9af2f40df678db2e418788a66e634 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 29 Jun 2026 04:17:51 +0900 Subject: feat(package): implement RootAliasPackage root getters via owned returns It is faithful to PHP's by-value array/string semantics. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/package/root_alias_package.rs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'crates/shirabe/src/package/root_alias_package.rs') diff --git a/crates/shirabe/src/package/root_alias_package.rs b/crates/shirabe/src/package/root_alias_package.rs index 41b30a9..4a4115d 100644 --- a/crates/shirabe/src/package/root_alias_package.rs +++ b/crates/shirabe/src/package/root_alias_package.rs @@ -53,32 +53,28 @@ impl std::fmt::Display for RootAliasPackage { } impl RootPackageInterface for RootAliasPackage { - fn get_aliases(&self) -> &[IndexMap] { - todo!("RootAliasPackage::get_aliases cannot return a borrow across the aliasOf handle") + fn get_aliases(&self) -> Vec> { + self.alias_of.get_aliases() } - fn get_minimum_stability(&self) -> &str { - todo!( - "RootAliasPackage::get_minimum_stability cannot return &str across the aliasOf handle" - ) + fn get_minimum_stability(&self) -> String { + self.alias_of.get_minimum_stability() } - fn get_stability_flags(&self) -> &IndexMap { - todo!( - "RootAliasPackage::get_stability_flags cannot return a borrow across the aliasOf handle" - ) + fn get_stability_flags(&self) -> IndexMap { + self.alias_of.get_stability_flags() } - fn get_references(&self) -> &IndexMap { - todo!("RootAliasPackage::get_references cannot return a borrow across the aliasOf handle") + fn get_references(&self) -> IndexMap { + self.alias_of.get_references() } fn get_prefer_stable(&self) -> bool { self.alias_of.get_prefer_stable() } - fn get_config(&self) -> &IndexMap { - todo!("RootAliasPackage::get_config cannot return a borrow across the aliasOf handle") + fn get_config(&self) -> IndexMap { + self.alias_of.get_config() } fn set_requires(&mut self, requires: IndexMap) { -- cgit v1.3.1