From 9be0f98f71fe8071ab839ac1036b4064ac3172b4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 29 Jun 2026 00:03:00 +0900 Subject: 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) --- crates/shirabe/src/repository/vcs_repository.rs | 13 ++++++------- 1 file changed, 6 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 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>>, drivers: Option>, version_cache: Option>, - ) -> Result { + ) -> anyhow::Result { let inner = ArrayRepository::new(vec![])?; let drivers = drivers.unwrap_or_else(|| { let mut m: IndexMap = 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, identifier: &str, - ) -> Result> { + ) -> anyhow::Result> { // 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 { + ) -> anyhow::Result { if self.version_cache.is_none() { return Ok(CachedPackageResult::None); } -- cgit v1.3.1