Skip to content

Commit

Permalink
remove Report::new
Browse files Browse the repository at this point in the history
  • Loading branch information
asmello committed Nov 18, 2024
1 parent a728f72 commit 1404c61
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self::Subject>) -> Report<Self, Self::Subject> {
Report::new(self, subject)
Report {
source: self,
subject: subject.into(),
}
}

/// The docs.rs URL for this error
Expand Down Expand Up @@ -49,14 +52,6 @@ pub struct Report<SRC, SUB> {
}

impl<SRC, SUB> Report<SRC, SUB> {
/// Create a new `Report` with the given subject and error.
fn new(source: SRC, subject: impl Into<SUB>) -> Self {
Self {
source,
subject: subject.into(),
}
}

/// The value which caused the error.
pub fn subject(&self) -> &SUB {
&self.subject
Expand Down

0 comments on commit 1404c61

Please sign in to comment.