Skip to content

Commit 2084b6b

Browse files
fix: 1.90 errors
1 parent 98e0ac9 commit 2084b6b

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

miette-derive/src/utils.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use proc_macro2::TokenStream;
22
use quote::{format_ident, quote};
3-
use syn::{
4-
spanned::Spanned,
5-
};
3+
use syn::spanned::Spanned;
64

75
use crate::{
86
diagnostic::{DiagnosticConcreteArgs, DiagnosticDef},

src/eyreish/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,7 @@ pub trait ReportHandler: core::any::Any + Send + Sync {
172172
/// }
173173
/// }
174174
/// ```
175-
fn debug(
176-
&self,
177-
error: &(dyn Diagnostic),
178-
f: &mut core::fmt::Formatter<'_>,
179-
) -> core::fmt::Result;
175+
fn debug(&self, error: &dyn Diagnostic, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result;
180176

181177
/// Override for the `Display` format
182178
fn display(

src/handlers/debug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl DebugReportHandler {
3131
pub fn render_report(
3232
&self,
3333
f: &mut fmt::Formatter<'_>,
34-
diagnostic: &(dyn Diagnostic),
34+
diagnostic: &dyn Diagnostic,
3535
) -> fmt::Result {
3636
let mut diag = f.debug_struct("Diagnostic");
3737
diag.field("message", &format!("{}", diagnostic));
@@ -61,7 +61,7 @@ impl DebugReportHandler {
6161
}
6262

6363
impl ReportHandler for DebugReportHandler {
64-
fn debug(&self, diagnostic: &(dyn Diagnostic), f: &mut fmt::Formatter<'_>) -> fmt::Result {
64+
fn debug(&self, diagnostic: &dyn Diagnostic, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6565
if f.alternate() {
6666
return fmt::Debug::fmt(diagnostic, f);
6767
}

src/handlers/json.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ impl JSONReportHandler {
6060
pub fn render_report(
6161
&self,
6262
f: &mut impl fmt::Write,
63-
diagnostic: &(dyn Diagnostic),
63+
diagnostic: &dyn Diagnostic,
6464
) -> fmt::Result {
6565
self._render_report(f, diagnostic, None)
6666
}
6767

6868
fn _render_report(
6969
&self,
7070
f: &mut impl fmt::Write,
71-
diagnostic: &(dyn Diagnostic),
71+
diagnostic: &dyn Diagnostic,
7272
parent_src: Option<&dyn SourceCode>,
7373
) -> fmt::Result {
7474
write!(f, r#"{{"message": "{}","#, escape(&diagnostic.to_string()))?;
@@ -154,7 +154,7 @@ impl JSONReportHandler {
154154
fn render_snippets(
155155
&self,
156156
f: &mut impl fmt::Write,
157-
diagnostic: &(dyn Diagnostic),
157+
diagnostic: &dyn Diagnostic,
158158
source: &dyn SourceCode,
159159
) -> fmt::Result {
160160
if let Some(mut labels) = diagnostic.labels() {
@@ -170,7 +170,7 @@ impl JSONReportHandler {
170170
}
171171

172172
impl ReportHandler for JSONReportHandler {
173-
fn debug(&self, diagnostic: &(dyn Diagnostic), f: &mut fmt::Formatter<'_>) -> fmt::Result {
173+
fn debug(&self, diagnostic: &dyn Diagnostic, f: &mut fmt::Formatter<'_>) -> fmt::Result {
174174
self.render_report(f, diagnostic)
175175
}
176176
}

src/handlers/narratable.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl NarratableReportHandler {
6969
pub fn render_report(
7070
&self,
7171
f: &mut impl fmt::Write,
72-
diagnostic: &(dyn Diagnostic),
72+
diagnostic: &dyn Diagnostic,
7373
) -> fmt::Result {
7474
self.render_header(f, diagnostic)?;
7575
if self.with_cause_chain {
@@ -85,7 +85,7 @@ impl NarratableReportHandler {
8585
Ok(())
8686
}
8787

88-
fn render_header(&self, f: &mut impl fmt::Write, diagnostic: &(dyn Diagnostic)) -> fmt::Result {
88+
fn render_header(&self, f: &mut impl fmt::Write, diagnostic: &dyn Diagnostic) -> fmt::Result {
8989
writeln!(f, "{}", diagnostic)?;
9090
let severity = match diagnostic.severity() {
9191
Some(Severity::Error) | None => "error",
@@ -96,7 +96,7 @@ impl NarratableReportHandler {
9696
Ok(())
9797
}
9898

99-
fn render_causes(&self, f: &mut impl fmt::Write, diagnostic: &(dyn Diagnostic)) -> fmt::Result {
99+
fn render_causes(&self, f: &mut impl fmt::Write, diagnostic: &dyn Diagnostic) -> fmt::Result {
100100
if let Some(cause_iter) = diagnostic
101101
.diagnostic_source()
102102
.map(DiagnosticChain::from_diagnostic)
@@ -110,7 +110,7 @@ impl NarratableReportHandler {
110110
Ok(())
111111
}
112112

113-
fn render_footer(&self, f: &mut impl fmt::Write, diagnostic: &(dyn Diagnostic)) -> fmt::Result {
113+
fn render_footer(&self, f: &mut impl fmt::Write, diagnostic: &dyn Diagnostic) -> fmt::Result {
114114
if let Some(help) = diagnostic.help() {
115115
writeln!(f, "diagnostic help: {}", help)?;
116116
}
@@ -126,7 +126,7 @@ impl NarratableReportHandler {
126126
fn render_related(
127127
&self,
128128
f: &mut impl fmt::Write,
129-
diagnostic: &(dyn Diagnostic),
129+
diagnostic: &dyn Diagnostic,
130130
parent_src: Option<&dyn SourceCode>,
131131
) -> fmt::Result {
132132
if let Some(related) = diagnostic.related() {
@@ -152,7 +152,7 @@ impl NarratableReportHandler {
152152
fn render_snippets(
153153
&self,
154154
f: &mut impl fmt::Write,
155-
diagnostic: &(dyn Diagnostic),
155+
diagnostic: &dyn Diagnostic,
156156
source_code: Option<&dyn SourceCode>,
157157
) -> fmt::Result {
158158
if let Some(source) = source_code {
@@ -344,7 +344,7 @@ impl NarratableReportHandler {
344344
}
345345

346346
impl ReportHandler for NarratableReportHandler {
347-
fn debug(&self, diagnostic: &(dyn Diagnostic), f: &mut fmt::Formatter<'_>) -> fmt::Result {
347+
fn debug(&self, diagnostic: &dyn Diagnostic, f: &mut fmt::Formatter<'_>) -> fmt::Result {
348348
if f.alternate() {
349349
return fmt::Debug::fmt(diagnostic, f);
350350
}

0 commit comments

Comments
 (0)