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/downloader/hg_downloader.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'crates/shirabe/src/downloader/hg_downloader.rs') diff --git a/crates/shirabe/src/downloader/hg_downloader.rs b/crates/shirabe/src/downloader/hg_downloader.rs index 650746b..5cc6f34 100644 --- a/crates/shirabe/src/downloader/hg_downloader.rs +++ b/crates/shirabe/src/downloader/hg_downloader.rs @@ -12,7 +12,6 @@ use crate::package::PackageInterfaceHandle; use crate::util::Filesystem; use crate::util::Hg as HgUtils; use crate::util::ProcessExecutor; -use anyhow::Result; use indexmap::IndexMap; use shirabe_php_shim::{PhpMixed, RuntimeException}; @@ -65,7 +64,7 @@ impl VcsDownloader for HgDownloader { _path: &str, _url: &str, _prev_package: Option, - ) -> Result> { + ) -> anyhow::Result> { if HgUtils::get_version(&self.inner.process).is_none() { return Err(RuntimeException { message: "hg was not found in your PATH, skipping source download".to_string(), @@ -82,7 +81,7 @@ impl VcsDownloader for HgDownloader { package: PackageInterfaceHandle, path: &str, url: &str, - ) -> Result> { + ) -> anyhow::Result> { let hg_utils = HgUtils::new( self.inner.io.clone(), self.inner.config.clone(), @@ -137,7 +136,7 @@ impl VcsDownloader for HgDownloader { target: PackageInterfaceHandle, path: &str, url: &str, - ) -> Result> { + ) -> anyhow::Result> { let hg_utils = HgUtils::new( self.inner.io.clone(), self.inner.config.clone(), @@ -187,7 +186,7 @@ impl VcsDownloader for HgDownloader { from_reference: &str, to_reference: &str, path: &str, - ) -> Result { + ) -> anyhow::Result { let command = vec![ "hg".to_string(), "log".to_string(), @@ -228,7 +227,7 @@ impl ChangeReportInterface for HgDownloader { &mut self, _package: PackageInterfaceHandle, path: &str, - ) -> Result> { + ) -> anyhow::Result> { if !std::path::Path::new(&format!("{}/.hg", path)).is_dir() { return Ok(None); } @@ -280,7 +279,7 @@ impl DownloaderInterface for HgDownloader { path: &str, prev_package: Option, _output: bool, - ) -> Result> { + ) -> anyhow::Result> { ::download(self, package, path, prev_package).await } @@ -290,7 +289,7 @@ impl DownloaderInterface for HgDownloader { package: PackageInterfaceHandle, path: &str, prev_package: Option, - ) -> Result> { + ) -> anyhow::Result> { ::prepare(self, r#type, package, path, prev_package).await } @@ -299,7 +298,7 @@ impl DownloaderInterface for HgDownloader { package: PackageInterfaceHandle, path: &str, _output: bool, - ) -> Result> { + ) -> anyhow::Result> { ::install(self, package, path).await } @@ -308,7 +307,7 @@ impl DownloaderInterface for HgDownloader { initial: PackageInterfaceHandle, target: PackageInterfaceHandle, path: &str, - ) -> Result> { + ) -> anyhow::Result> { ::update(self, initial, target, path).await } @@ -317,7 +316,7 @@ impl DownloaderInterface for HgDownloader { package: PackageInterfaceHandle, path: &str, _output: bool, - ) -> Result> { + ) -> anyhow::Result> { ::remove(self, package, path).await } @@ -327,7 +326,7 @@ impl DownloaderInterface for HgDownloader { package: PackageInterfaceHandle, path: &str, prev_package: Option, - ) -> Result> { + ) -> anyhow::Result> { ::cleanup(self, r#type, package, path, prev_package).await } } -- cgit v1.3.1