diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-29 00:03:00 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-29 00:03:00 +0900 |
| commit | 9be0f98f71fe8071ab839ac1036b4064ac3172b4 (patch) | |
| tree | 66a2f4feba752f4761c40449e0827ad74fc9b02c /crates/shirabe/src/repository/vcs_repository.rs | |
| parent | a84d531548efa678d4021cea891826e59f8fb462 (diff) | |
| download | php-shirabe-9be0f98f71fe8071ab839ac1036b4064ac3172b4.tar.gz php-shirabe-9be0f98f71fe8071ab839ac1036b4064ac3172b4.tar.zst php-shirabe-9be0f98f71fe8071ab839ac1036b4064ac3172b4.zip | |
chore(lint): ban bare `use anyhow::Result` and fully qualify it
Add a no_banned_use linter that forbids importing anyhow::Result, and
update all call sites to reference it via its fully-qualified path so
it is never confused with std::result::Result.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/repository/vcs_repository.rs')
| -rw-r--r-- | crates/shirabe/src/repository/vcs_repository.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/shirabe/src/repository/vcs_repository.rs b/crates/shirabe/src/repository/vcs_repository.rs index d799532..8d747c6 100644 --- a/crates/shirabe/src/repository/vcs_repository.rs +++ b/crates/shirabe/src/repository/vcs_repository.rs @@ -26,7 +26,6 @@ use crate::util::HttpDownloader; use crate::util::Platform; use crate::util::ProcessExecutor; use crate::util::Url; -use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::Preg; use shirabe_php_shim::{InvalidArgumentException, PhpMixed, in_array, str_replace, strpos}; @@ -103,7 +102,7 @@ impl VcsRepository { process: Option<std::rc::Rc<std::cell::RefCell<ProcessExecutor>>>, drivers: Option<IndexMap<String, VcsDriverKind>>, version_cache: Option<Box<dyn VersionCacheInterface>>, - ) -> Result<Self> { + ) -> anyhow::Result<Self> { let inner = ArrayRepository::new(vec![])?; let drivers = drivers.unwrap_or_else(|| { let mut m: IndexMap<String, VcsDriverKind> = IndexMap::new(); @@ -297,7 +296,7 @@ impl VcsRepository { Ok(()) } - pub fn initialize(&self) -> Result<()> { + pub fn initialize(&self) -> anyhow::Result<()> { self.inner.initialize(); let is_verbose = self.is_verbose; @@ -436,7 +435,7 @@ impl VcsRepository { .overwrite_error4(&msg, false, None, io_interface::NORMAL); } - let result: Result<()> = (|| -> Result<()> { + let result: anyhow::Result<()> = (|| -> anyhow::Result<()> { let data_opt = self .driver .borrow_mut() @@ -708,7 +707,7 @@ impl VcsRepository { CachedPackageResult::None => {} } - let result: Result<()> = (|| -> Result<()> { + let result: anyhow::Result<()> = (|| -> anyhow::Result<()> { let data_opt = self .driver .borrow_mut() @@ -847,7 +846,7 @@ impl VcsRepository { driver: &dyn VcsDriverInterface, mut data: IndexMap<String, PhpMixed>, identifier: &str, - ) -> Result<IndexMap<String, PhpMixed>> { + ) -> anyhow::Result<IndexMap<String, PhpMixed>> { // keep the name of the main identifier for all packages // this ensures that a package can be renamed in one place and that all old tags // will still be installable using that new name without requiring re-tagging @@ -963,7 +962,7 @@ impl VcsRepository { is_verbose: bool, is_very_verbose: bool, is_default_branch: bool, - ) -> Result<CachedPackageResult> { + ) -> anyhow::Result<CachedPackageResult> { if self.version_cache.is_none() { return Ok(CachedPackageResult::None); } |
