diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-10 00:54:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-10 00:54:58 +0900 |
| commit | e583112899cbea7494ffdd73d7de380dd5f808c4 (patch) | |
| tree | 1ec002a4d9ab5af5f81ff3bc0ae0ea6a92e44c10 /crates/shirabe/src/repository/installed_array_repository.rs | |
| parent | 436e12381dd79e419dce755718be17b66d73e17f (diff) | |
| download | php-shirabe-e583112899cbea7494ffdd73d7de380dd5f808c4.tar.gz php-shirabe-e583112899cbea7494ffdd73d7de380dd5f808c4.tar.zst php-shirabe-e583112899cbea7494ffdd73d7de380dd5f808c4.zip | |
feat(phase-c): resolve exception-handling phase-b TODOs
* Catch specific exception types instead of broad/placeholder handling.
* Drop the shim Countable trait.
Diffstat (limited to 'crates/shirabe/src/repository/installed_array_repository.rs')
| -rw-r--r-- | crates/shirabe/src/repository/installed_array_repository.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/shirabe/src/repository/installed_array_repository.rs b/crates/shirabe/src/repository/installed_array_repository.rs index 64098e9..487a6da 100644 --- a/crates/shirabe/src/repository/installed_array_repository.rs +++ b/crates/shirabe/src/repository/installed_array_repository.rs @@ -1,7 +1,6 @@ //! ref: composer/src/Composer/Repository/InstalledArrayRepository.php use indexmap::IndexMap; -use shirabe_php_shim::Countable; use shirabe_semver::constraint::AnyConstraint; use crate::package::BasePackageHandle; @@ -41,7 +40,10 @@ impl InstalledRepositoryInterface for InstalledArrayRepository { } fn is_fresh(&self) -> bool { - self.inner.count() == 0 + self.inner + .count() + .expect("WritableArrayRepository::count is infallible") + == 0 } } @@ -87,13 +89,11 @@ impl WritableRepositoryInterface for InstalledArrayRepository { } } -impl Countable for InstalledArrayRepository { - fn count(&self) -> i64 { +impl RepositoryInterface for InstalledArrayRepository { + fn count(&self) -> anyhow::Result<usize> { todo!() } -} -impl RepositoryInterface for InstalledArrayRepository { fn has_package(&self, _package: PackageInterfaceHandle) -> bool { todo!() } |
