From 1404c619ff89d8592144c35b6f01f4583b31ae6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1=20de=20Mello?= Date: Mon, 18 Nov 2024 15:46:39 +0000 Subject: [PATCH] remove Report::new --- src/diagnostic.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/diagnostic.rs b/src/diagnostic.rs index 445a8f4..354232d 100644 --- a/src/diagnostic.rs +++ b/src/diagnostic.rs @@ -9,7 +9,10 @@ pub trait Diagnostic<'s>: Sized + private::Sealed { /// Combine the error with its subject to generate a [`Report`]. fn into_report(self, subject: impl Into) -> Report { - Report::new(self, subject) + Report { + source: self, + subject: subject.into(), + } } /// The docs.rs URL for this error @@ -49,14 +52,6 @@ pub struct Report { } impl Report { - /// Create a new `Report` with the given subject and error. - fn new(source: SRC, subject: impl Into) -> Self { - Self { - source, - subject: subject.into(), - } - } - /// The value which caused the error. pub fn subject(&self) -> &SUB { &self.subject