From 90ebddc8fd17bac1064fb5a0da88a9ad535f5a3c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 5 Jul 2026 18:44:06 +0900 Subject: feat(validating-array-loader): implement LoaderInterface Convert errors/warnings/config to RefCell so load() can satisfy the trait's &self signature, matching upstream's `instanceof ValidatingArrayLoader` check in VcsRepository. This makes the InvalidPackageException downcast path in VcsRepository reachable for the first time instead of being permanently dead code. --- crates/shirabe/src/repository/vcs_repository.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'crates/shirabe/src/repository/vcs_repository.rs') diff --git a/crates/shirabe/src/repository/vcs_repository.rs b/crates/shirabe/src/repository/vcs_repository.rs index 6a31c78..29702db 100644 --- a/crates/shirabe/src/repository/vcs_repository.rs +++ b/crates/shirabe/src/repository/vcs_repository.rs @@ -767,11 +767,6 @@ impl VcsRepository { .unwrap() .load(package_data.clone(), None)?; // PHP: `$this->loader instanceof ValidatingArrayLoader`. - // TODO(phase-c): ValidatingArrayLoader does not implement LoaderInterface yet (its - // `load` needs `&mut self`, requiring a LoaderInterface redesign), so it can never be - // stored in `self.loader` and this downcast is always None. Production never calls - // setLoader so the default ArrayLoader matches upstream, but the InvalidPackageException - // path stays dead until the trait is reworked. let loader_ref = self.loader.borrow(); let loader_as_validating = loader_ref .as_ref() @@ -780,8 +775,8 @@ impl VcsRepository { && !validating.get_warnings().is_empty() { return Err(InvalidPackageException::new( - validating.get_errors().to_vec(), - validating.get_warnings().to_vec(), + validating.get_errors(), + validating.get_warnings(), package_data, ) .into()); -- cgit v1.3.1