aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader/path_downloader.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-29 00:03:00 +0900
committernsfisis <nsfisis@gmail.com>2026-06-29 00:03:00 +0900
commit9be0f98f71fe8071ab839ac1036b4064ac3172b4 (patch)
tree66a2f4feba752f4761c40449e0827ad74fc9b02c /crates/shirabe/src/downloader/path_downloader.rs
parenta84d531548efa678d4021cea891826e59f8fb462 (diff)
downloadphp-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/downloader/path_downloader.rs')
-rw-r--r--crates/shirabe/src/downloader/path_downloader.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/crates/shirabe/src/downloader/path_downloader.rs b/crates/shirabe/src/downloader/path_downloader.rs
index cfd4889..5dc51b3 100644
--- a/crates/shirabe/src/downloader/path_downloader.rs
+++ b/crates/shirabe/src/downloader/path_downloader.rs
@@ -20,7 +20,6 @@ use crate::util::Filesystem;
use crate::util::HttpDownloader;
use crate::util::Platform;
use crate::util::ProcessExecutor;
-use anyhow::Result;
use indexmap::IndexMap;
use shirabe_external_packages::symfony::filesystem::Filesystem as SymfonyFilesystem;
use shirabe_php_shim::{
@@ -83,7 +82,7 @@ impl PathDownloader {
&self,
package: PackageInterfaceHandle,
path: &str,
- ) -> Result<String> {
+ ) -> anyhow::Result<String> {
let url = package.get_dist_url().ok_or_else(|| RuntimeException {
message: format!(
"The package {} has no dist url configured, cannot install.",
@@ -126,7 +125,7 @@ impl PathDownloader {
fn compute_allowed_strategies(
&self,
transport_options: &IndexMap<String, PhpMixed>,
- ) -> Result<(i64, Vec<i64>)> {
+ ) -> anyhow::Result<(i64, Vec<i64>)> {
// When symlink transport option is null, both symlink and mirror are allowed
let mut current_strategy = Self::STRATEGY_SYMLINK;
let mut allowed_strategies = vec![Self::STRATEGY_SYMLINK, Self::STRATEGY_MIRROR];
@@ -242,7 +241,7 @@ impl DownloaderInterface for PathDownloader {
path: &str,
prev_package: Option<PackageInterfaceHandle>,
output: bool,
- ) -> Result<Option<PhpMixed>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
let path = Filesystem::trim_trailing_slash(path);
let url = package.get_dist_url().ok_or_else(|| RuntimeException {
message: format!(
@@ -304,7 +303,7 @@ impl DownloaderInterface for PathDownloader {
package: PackageInterfaceHandle,
path: &str,
prev_package: Option<PackageInterfaceHandle>,
- ) -> Result<Option<PhpMixed>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
self.inner
.prepare(r#type, package, path, prev_package)
.await
@@ -315,7 +314,7 @@ impl DownloaderInterface for PathDownloader {
package: PackageInterfaceHandle,
path: &str,
output: bool,
- ) -> Result<Option<PhpMixed>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
let path = Filesystem::trim_trailing_slash(path);
let url = package.get_dist_url().ok_or_else(|| RuntimeException {
message: format!(
@@ -368,7 +367,7 @@ impl DownloaderInterface for PathDownloader {
let mut is_fallback = false;
if Self::STRATEGY_SYMLINK == current_strategy {
- let symlink_result: Result<anyhow::Result<()>> =
+ let symlink_result: anyhow::Result<anyhow::Result<()>> =
(|| {
if Platform::is_windows() {
// Implement symlinks as NTFS junctions on Windows
@@ -489,7 +488,7 @@ impl DownloaderInterface for PathDownloader {
initial: PackageInterfaceHandle,
target: PackageInterfaceHandle,
path: &str,
- ) -> Result<Option<PhpMixed>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
self.inner.update(initial, target, path).await
}
@@ -498,7 +497,7 @@ impl DownloaderInterface for PathDownloader {
package: PackageInterfaceHandle,
path: &str,
output: bool,
- ) -> Result<Option<PhpMixed>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
let path = Filesystem::trim_trailing_slash(path);
// realpath() may resolve Windows junctions to the source path, so we'll check for a junction
// first to prevent a false positive when checking if the dist and install paths are the same.
@@ -590,7 +589,7 @@ impl DownloaderInterface for PathDownloader {
package: PackageInterfaceHandle,
path: &str,
prev_package: Option<PackageInterfaceHandle>,
- ) -> Result<Option<PhpMixed>> {
+ ) -> anyhow::Result<Option<PhpMixed>> {
self.inner
.cleanup(r#type, package, path, prev_package)
.await