Skip to content

Commit

Permalink
Add default implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Nov 30, 2023
1 parent 5012272 commit 2f20e6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/internal/incompatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ impl<P: Package, VS: VersionSet> fmt::Display for Incompatibility<P, VS> {
write!(
f,
"{}",
DefaultStringReportFormatter {}.format_terms(&self.package_terms.as_map())
DefaultStringReportFormatter::default().format_terms(&self.package_terms.as_map())
)
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ pub trait ReportFormatter<P: Package, VS: VersionSet> {
}

/// Default formatter for the default reporter.
#[derive(Default, Debug)]
pub struct DefaultStringReportFormatter;

impl<P: Package, VS: VersionSet> ReportFormatter<P, VS> for DefaultStringReportFormatter {
Expand Down Expand Up @@ -564,7 +565,7 @@ impl<P: Package, VS: VersionSet> Reporter<P, VS> for DefaultStringReporter {
type Output = String;

fn report(derivation_tree: &DerivationTree<P, VS>) -> Self::Output {
let formatter = DefaultStringReportFormatter {};
let formatter = DefaultStringReportFormatter::default();
match derivation_tree {
DerivationTree::External(external) => formatter.format_external(external),
DerivationTree::Derived(derived) => {
Expand Down

0 comments on commit 2f20e6c

Please sign in to comment.