aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs')
-rw-r--r--crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs25
1 files changed, 5 insertions, 20 deletions
diff --git a/crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs b/crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs
index 3c0de332..4e4000df 100644
--- a/crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs
+++ b/crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs
@@ -1,10 +1,9 @@
//! ref: composer/src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php
-use crate::dependency_resolver::operation::OperationInterface;
use crate::dependency_resolver::operation::SolverOperation;
use crate::package::AliasPackageHandle;
-#[derive(Debug)]
+#[derive(Debug, Clone)]
pub struct MarkAliasUninstalledOperation {
pub(crate) package: AliasPackageHandle,
}
@@ -17,22 +16,8 @@ impl MarkAliasUninstalledOperation {
pub fn get_package(&self) -> AliasPackageHandle {
self.package.clone()
}
-}
-
-impl SolverOperation for MarkAliasUninstalledOperation {
- const TYPE: &'static str = "markAliasUninstalled";
-}
-
-impl OperationInterface for MarkAliasUninstalledOperation {
- fn as_any(&self) -> &dyn std::any::Any {
- self
- }
- fn get_operation_type(&self) -> String {
- Self::TYPE.to_string()
- }
-
- fn show(&self, _lock: bool) -> String {
+ pub fn show(&self, _lock: bool) -> String {
format!(
"Marking <info>{}</info> (<comment>{}</comment>) as uninstalled, alias of <info>{}</info> (<comment>{}</comment>)",
self.package.get_pretty_name(),
@@ -44,10 +29,10 @@ impl OperationInterface for MarkAliasUninstalledOperation {
.get_full_pretty_version(true, crate::package::DisplayMode::SourceRefIfDev),
)
}
+}
- fn get_package(&self) -> crate::package::PackageInterfaceHandle {
- self.package.clone().into()
- }
+impl SolverOperation for MarkAliasUninstalledOperation {
+ const TYPE: &'static str = "markAliasUninstalled";
}
impl std::fmt::Display for MarkAliasUninstalledOperation {