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/installer/plugin_installer.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/installer/plugin_installer.rs')
| -rw-r--r-- | crates/shirabe/src/installer/plugin_installer.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/crates/shirabe/src/installer/plugin_installer.rs b/crates/shirabe/src/installer/plugin_installer.rs index 28e4e0d..132d408 100644 --- a/crates/shirabe/src/installer/plugin_installer.rs +++ b/crates/shirabe/src/installer/plugin_installer.rs @@ -11,7 +11,6 @@ use crate::plugin::PluginManager; use crate::repository::InstalledRepositoryInterface; use crate::util::Filesystem; use crate::util::Platform; -use anyhow::Result; use shirabe_php_shim::{PhpMixed, UnexpectedValueException, empty}; #[derive(Debug)] @@ -49,7 +48,7 @@ impl PluginInstaller { e: anyhow::Error, repo: &mut dyn InstalledRepositoryInterface, package: PackageInterfaceHandle, - ) -> Result<()> { + ) -> anyhow::Result<()> { self.inner.io.write_error(&format!( "Plugin initialization failed ({}), uninstalling plugin", e @@ -83,7 +82,7 @@ impl InstallerInterface for PluginInstaller { r#type: &str, package: PackageInterfaceHandle, prev_package: Option<PackageInterfaceHandle>, - ) -> Result<Option<PhpMixed>> { + ) -> anyhow::Result<Option<PhpMixed>> { if (r#type == "install" || r#type == "update") && !self .get_plugin_manager() @@ -110,7 +109,7 @@ impl InstallerInterface for PluginInstaller { &mut self, package: PackageInterfaceHandle, prev_package: Option<PackageInterfaceHandle>, - ) -> Result<Option<PhpMixed>> { + ) -> anyhow::Result<Option<PhpMixed>> { let extra = package.get_extra(); let class = extra.get("class").cloned().unwrap_or(PhpMixed::Null); if empty(&class) { @@ -130,7 +129,7 @@ impl InstallerInterface for PluginInstaller { &mut self, repo: &mut dyn InstalledRepositoryInterface, package: PackageInterfaceHandle, - ) -> Result<Option<PhpMixed>> { + ) -> anyhow::Result<Option<PhpMixed>> { self.inner.install(repo, package).await?; // TODO(plugin): register package in plugin manager after install, rollback on failure @@ -145,7 +144,7 @@ impl InstallerInterface for PluginInstaller { repo: &mut dyn InstalledRepositoryInterface, initial: PackageInterfaceHandle, target: PackageInterfaceHandle, - ) -> Result<Option<PhpMixed>> { + ) -> anyhow::Result<Option<PhpMixed>> { self.inner.update(repo, initial, target).await?; // TODO(plugin): deactivate initial and register target in plugin manager after update, rollback on failure @@ -160,7 +159,7 @@ impl InstallerInterface for PluginInstaller { &mut self, repo: &mut dyn InstalledRepositoryInterface, package: PackageInterfaceHandle, - ) -> Result<Option<PhpMixed>> { + ) -> anyhow::Result<Option<PhpMixed>> { // TODO(plugin): uninstall package from plugin manager self.get_plugin_manager() .borrow_mut() @@ -174,7 +173,7 @@ impl InstallerInterface for PluginInstaller { r#type: &str, package: PackageInterfaceHandle, prev_package: Option<PackageInterfaceHandle>, - ) -> Result<Option<PhpMixed>> { + ) -> anyhow::Result<Option<PhpMixed>> { self.inner.cleanup(r#type, package, prev_package).await } |
