diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-20 01:16:50 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-20 02:22:41 +0900 |
| commit | efec43b3b8827820cf35fe1b73d8e33f5fe84eb4 (patch) | |
| tree | a62bbba72324de48be5f8e689559f8d9e288fc61 /crates/shirabe/src/installer/library_installer.rs | |
| parent | cac18ef73a39b4ac41fa4d6ccb753804d4c42cb7 (diff) | |
| download | php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.gz php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.zst php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.zip | |
refactor: auto-fix clippy warnings
Diffstat (limited to 'crates/shirabe/src/installer/library_installer.rs')
| -rw-r--r-- | crates/shirabe/src/installer/library_installer.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/crates/shirabe/src/installer/library_installer.rs b/crates/shirabe/src/installer/library_installer.rs index 9fb3e43..d2f222e 100644 --- a/crates/shirabe/src/installer/library_installer.rs +++ b/crates/shirabe/src/installer/library_installer.rs @@ -109,18 +109,18 @@ impl LibraryInstaller { let install_path = self.get_install_path(package.clone()).unwrap(); let target_dir = package.get_target_dir(); - if let Some(target_dir) = target_dir { - if !target_dir.is_empty() { - let replaced = Preg::replace( - &format!( - "{{/*{}/?$}}", - preg_quote(&target_dir, None).replace('/', "/+") - ), - "", - &install_path, - ); - return replaced; - } + if let Some(target_dir) = target_dir + && !target_dir.is_empty() + { + let replaced = Preg::replace( + &format!( + "{{/*{}/?$}}", + preg_quote(&target_dir, None).replace('/', "/+") + ), + "", + &install_path, + ); + return replaced; } install_path @@ -368,7 +368,7 @@ impl InstallerInterface for LibraryInstaller { self.binary_installer.remove_binaries(package.clone()); repo.remove_package(package.clone()); - if strpos(&package.get_name(), "/").map_or(false, |pos| pos != 0) { + if strpos(&package.get_name(), "/").is_some_and(|pos| pos != 0) { let package_vendor_dir = dirname(&download_path); if is_dir(&package_vendor_dir) && self.filesystem.borrow().is_dir_empty(&package_vendor_dir) |
