From 44e82cc7d937d49593c6f436d03a38f3371b6873 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 6 Jun 2026 15:36:28 +0900 Subject: refactor(operation,link): port __toString to Display Move __toString ports to std::fmt::Display: convert Link's inherent to_string() and make OperationInterface require Display instead of a to_string() method, with each operation implementing Display. Also fix the operation __toString output to use show(false), matching SolverOperation::__toString() (was show(true)). Co-Authored-By: Claude Opus 4.8 --- .../src/dependency_resolver/operation/uninstall_operation.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs') diff --git a/crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs b/crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs index 465297d..efb3610 100644 --- a/crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs +++ b/crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs @@ -44,11 +44,13 @@ impl OperationInterface for UninstallOperation { Self::format(self.package.clone(), lock) } - fn to_string(&self) -> String { - self.show(true) - } - fn as_uninstall_operation(&self) -> Option<&UninstallOperation> { Some(self) } } + +impl std::fmt::Display for UninstallOperation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.show(false)) + } +} -- cgit v1.3.1