diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-27 03:52:05 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-27 04:21:34 +0900 |
| commit | 2b51554ff59d1e5cbf8dd2db65d278b0202a9102 (patch) | |
| tree | f4d9b0abf4df9b5e363e3bd65511d70e3d5ada00 /crates/shirabe/src/factory.rs | |
| parent | cc07b5abb83a40d678401c335bdc49bb81b72c5f (diff) | |
| download | php-shirabe-2b51554ff59d1e5cbf8dd2db65d278b0202a9102.tar.gz php-shirabe-2b51554ff59d1e5cbf8dd2db65d278b0202a9102.tar.zst php-shirabe-2b51554ff59d1e5cbf8dd2db65d278b0202a9102.zip | |
refactor: fix compiler warnings and clippy warnings
Diffstat (limited to 'crates/shirabe/src/factory.rs')
| -rw-r--r-- | crates/shirabe/src/factory.rs | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/crates/shirabe/src/factory.rs b/crates/shirabe/src/factory.rs index 0c83d5d..8a97313 100644 --- a/crates/shirabe/src/factory.rs +++ b/crates/shirabe/src/factory.rs @@ -7,11 +7,10 @@ use shirabe_external_packages::symfony::console::formatter::OutputFormatterStyle use shirabe_external_packages::symfony::console::formatter::OutputFormatterStyleInterface; use shirabe_external_packages::symfony::console::output::ConsoleOutput; use shirabe_php_shim::{ - InvalidArgumentException, PATHINFO_EXTENSION, PHP_EOL, PHP_OS, Phar, PhpMixed, - RuntimeException, UnexpectedValueException, ZipArchive, array_keys, array_replace_recursive, - class_exists, dirname, extension_loaded, file_exists, file_get_contents, file_put_contents, - implode, in_array, is_array, is_dir, is_file, is_string, json_decode, mkdir, pathinfo, - realpath, rename, str_replace, strpos, strtr, substr, trim, + InvalidArgumentException, PATHINFO_EXTENSION, PHP_EOL, PHP_OS, PhpMixed, RuntimeException, + UnexpectedValueException, array_replace_recursive, class_exists, dirname, extension_loaded, + file_exists, file_get_contents, file_put_contents, implode, is_dir, is_file, json_decode, + mkdir, pathinfo, realpath, rename, strpos, strtr, substr, trim, }; use crate::autoload::AutoloadGenerator; @@ -40,16 +39,11 @@ use crate::event_dispatcher::EventDispatcher; use crate::exception::NoSslException; use crate::installer::BinaryInstaller; use crate::installer::InstallationManager; -use crate::installer::LibraryInstaller; -use crate::installer::MetapackageInstaller; -use crate::installer::PluginInstaller; use crate::io::IOInterface; use crate::io::IOInterfaceImmutable; -use crate::io::IOInterfaceMutable; use crate::json::JsonFile; use crate::json::JsonValidationException; use crate::package::Locker; -use crate::package::RootPackageInterface; use crate::package::RootPackageInterfaceHandle; use crate::package::archiver::ArchiveManager; use crate::package::archiver::PharArchiver; @@ -178,8 +172,8 @@ impl Factory { let user_dir = Self::get_user_dir()?; if PHP_OS == "Darwin" { // Migrate existing cache dir in old location if present - if is_dir(&format!("{}/cache", home)) - && !is_dir(&format!("{}/Library/Caches/composer", user_dir)) + if is_dir(format!("{}/cache", home)) + && !is_dir(format!("{}/Library/Caches/composer", user_dir)) { let from = format!("{}/cache", home); let to = format!("{}/Library/Caches/composer", user_dir); @@ -189,8 +183,7 @@ impl Factory { return Ok(format!("{}/Library/Caches/composer", user_dir)); } - if home == format!("{}/.composer", user_dir).as_str() && is_dir(&format!("{}/cache", home)) - { + if home == format!("{}/.composer", user_dir).as_str() && is_dir(format!("{}/cache", home)) { return Ok(format!("{}/cache", home)); } @@ -303,7 +296,7 @@ impl Factory { config.get_str("data-dir")?, ]; for dir in &dirs { - if !file_exists(&format!("{}/.htaccess", dir)) { + if !file_exists(format!("{}/.htaccess", dir)) { if !is_dir(dir) { let dir_owned = dir.clone(); let _ = Silencer::call(|| { |
