From 2f20e6c95e31907849ff1f0c81031d17b3d71ec8 Mon Sep 17 00:00:00 2001 From: Zanie Date: Thu, 30 Nov 2023 10:43:18 -0600 Subject: [PATCH] Add default implementation --- src/internal/incompatibility.rs | 2 +- src/report.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/internal/incompatibility.rs b/src/internal/incompatibility.rs index ec23830d..a06e846c 100644 --- a/src/internal/incompatibility.rs +++ b/src/internal/incompatibility.rs @@ -269,7 +269,7 @@ impl fmt::Display for Incompatibility { write!( f, "{}", - DefaultStringReportFormatter {}.format_terms(&self.package_terms.as_map()) + DefaultStringReportFormatter::default().format_terms(&self.package_terms.as_map()) ) } } diff --git a/src/report.rs b/src/report.rs index 233fc454..8c1e324a 100644 --- a/src/report.rs +++ b/src/report.rs @@ -223,6 +223,7 @@ pub trait ReportFormatter { } /// Default formatter for the default reporter. +#[derive(Default, Debug)] pub struct DefaultStringReportFormatter; impl ReportFormatter for DefaultStringReportFormatter { @@ -564,7 +565,7 @@ impl Reporter for DefaultStringReporter { type Output = String; fn report(derivation_tree: &DerivationTree) -> Self::Output { - let formatter = DefaultStringReportFormatter {}; + let formatter = DefaultStringReportFormatter::default(); match derivation_tree { DerivationTree::External(external) => formatter.format_external(external), DerivationTree::Derived(derived) => {