aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installer
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/installer')
-rw-r--r--crates/shirabe/src/installer/installation_manager.rs12
-rw-r--r--crates/shirabe/src/installer/metapackage_installer.rs6
-rw-r--r--crates/shirabe/src/installer/noop_installer.rs6
3 files changed, 11 insertions, 13 deletions
diff --git a/crates/shirabe/src/installer/installation_manager.rs b/crates/shirabe/src/installer/installation_manager.rs
index 4eb905ed..9517eada 100644
--- a/crates/shirabe/src/installer/installation_manager.rs
+++ b/crates/shirabe/src/installer/installation_manager.rs
@@ -184,7 +184,7 @@ impl InstallationManager {
.iter()
.position(|installer| installer.supports(&r#type));
if let Some(index) = index {
- self.cache.borrow_mut().insert(r#type.clone(), index);
+ self.cache.borrow_mut().insert(r#type, index);
return Ok(self.installers[index].clone());
}
@@ -208,14 +208,12 @@ impl InstallationManager {
if let Some(alias) = package.as_alias() {
let alias_of: PackageInterfaceHandle = alias.get_alias_of().into();
- return Ok(
- repo.has_package(package.clone()) && self.is_package_installed(repo, alias_of)?
- );
+ return Ok(repo.has_package(package) && self.is_package_installed(repo, alias_of)?);
}
Ok(self
.get_installer(&package.get_type())?
- .is_installed(repo, package.clone()))
+ .is_installed(repo, package))
}
/// Install binary for the given package.
@@ -778,7 +776,7 @@ impl InstallationManager {
) {
let package = operation.get_package();
- repo.remove_package(package.clone().into());
+ repo.remove_package(package.into());
}
/// Returns the installation path of a package
@@ -924,7 +922,7 @@ impl InstallationManager {
.borrow_mut()
.entry(notification_url)
.or_default()
- .push(package.clone());
+ .push(package);
}
}
diff --git a/crates/shirabe/src/installer/metapackage_installer.rs b/crates/shirabe/src/installer/metapackage_installer.rs
index b140f912..cb6d13c3 100644
--- a/crates/shirabe/src/installer/metapackage_installer.rs
+++ b/crates/shirabe/src/installer/metapackage_installer.rs
@@ -33,7 +33,7 @@ impl InstallerInterface for MetapackageInstaller {
repo: &dyn InstalledRepositoryInterface,
package: PackageInterfaceHandle,
) -> bool {
- repo.has_package(package.clone())
+ repo.has_package(package)
}
async fn download(
@@ -103,7 +103,7 @@ impl InstallerInterface for MetapackageInstaller {
);
let mut repo = repo.borrow_mut();
- repo.remove_package(initial.clone());
+ repo.remove_package(initial);
repo.add_package(PackageInterfaceHandle::dup(&target));
Ok(None)
@@ -128,7 +128,7 @@ impl InstallerInterface for MetapackageInstaller {
io_interface::NORMAL,
);
- repo.borrow_mut().remove_package(package.clone());
+ repo.borrow_mut().remove_package(package);
Ok(None)
}
diff --git a/crates/shirabe/src/installer/noop_installer.rs b/crates/shirabe/src/installer/noop_installer.rs
index 924bb46f..c83bf674 100644
--- a/crates/shirabe/src/installer/noop_installer.rs
+++ b/crates/shirabe/src/installer/noop_installer.rs
@@ -19,7 +19,7 @@ impl InstallerInterface for NoopInstaller {
repo: &dyn InstalledRepositoryInterface,
package: PackageInterfaceHandle,
) -> bool {
- repo.has_package(package.clone())
+ repo.has_package(package)
}
async fn download(
@@ -76,7 +76,7 @@ impl InstallerInterface for NoopInstaller {
.into());
}
- repo.remove_package(initial.clone());
+ repo.remove_package(initial);
if !repo.has_package(target.clone()) {
repo.add_package(PackageInterfaceHandle::dup(&target));
}
@@ -97,7 +97,7 @@ impl InstallerInterface for NoopInstaller {
}
.into());
}
- repo.remove_package(package.clone());
+ repo.remove_package(package);
Ok(None)
}