Skip to content

Commit 2249489

Browse files
fix: 1.90 errors
1 parent 98e0ac9 commit 2249489

File tree

7 files changed

+24
-30
lines changed

7 files changed

+24
-30
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/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ impl Default for MietteHandler {
402402
}
403403

404404
impl ReportHandler for MietteHandler {
405-
fn debug(&self, diagnostic: &(dyn Diagnostic), f: &mut fmt::Formatter<'_>) -> fmt::Result {
405+
fn debug(&self, diagnostic: &dyn Diagnostic, f: &mut fmt::Formatter<'_>) -> fmt::Result {
406406
if f.alternate() {
407407
return fmt::Debug::fmt(diagnostic, f);
408408
}

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/graphical.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,15 @@ impl GraphicalReportHandler {
242242
pub fn render_report(
243243
&self,
244244
f: &mut impl fmt::Write,
245-
diagnostic: &(dyn Diagnostic),
245+
diagnostic: &dyn Diagnostic,
246246
) -> fmt::Result {
247247
self.render_report_inner(f, diagnostic, diagnostic.source_code())
248248
}
249249

250250
fn render_report_inner(
251251
&self,
252252
f: &mut impl fmt::Write,
253-
diagnostic: &(dyn Diagnostic),
253+
diagnostic: &dyn Diagnostic,
254254
parent_src: Option<&dyn SourceCode>,
255255
) -> fmt::Result {
256256
let src = diagnostic.source_code().or(parent_src);
@@ -281,7 +281,7 @@ impl GraphicalReportHandler {
281281
fn render_header(
282282
&self,
283283
f: &mut impl fmt::Write,
284-
diagnostic: &(dyn Diagnostic),
284+
diagnostic: &dyn Diagnostic,
285285
is_nested: bool,
286286
) -> fmt::Result {
287287
let severity_style = match diagnostic.severity() {
@@ -326,7 +326,7 @@ impl GraphicalReportHandler {
326326
fn render_causes(
327327
&self,
328328
f: &mut impl fmt::Write,
329-
diagnostic: &(dyn Diagnostic),
329+
diagnostic: &dyn Diagnostic,
330330
parent_src: Option<&dyn SourceCode>,
331331
) -> fmt::Result {
332332
let src = diagnostic.source_code().or(parent_src);
@@ -424,7 +424,7 @@ impl GraphicalReportHandler {
424424
Ok(())
425425
}
426426

427-
fn render_footer(&self, f: &mut impl fmt::Write, diagnostic: &(dyn Diagnostic)) -> fmt::Result {
427+
fn render_footer(&self, f: &mut impl fmt::Write, diagnostic: &dyn Diagnostic) -> fmt::Result {
428428
if let Some(help) = diagnostic.help() {
429429
let width = self.termwidth.saturating_sub(2);
430430
let initial_indent = " help: ".style(self.theme.styles.help).to_string();
@@ -447,7 +447,7 @@ impl GraphicalReportHandler {
447447
fn render_related(
448448
&self,
449449
f: &mut impl fmt::Write,
450-
diagnostic: &(dyn Diagnostic),
450+
diagnostic: &dyn Diagnostic,
451451
parent_src: Option<&dyn SourceCode>,
452452
) -> fmt::Result {
453453
let src = diagnostic.source_code().or(parent_src);
@@ -535,7 +535,7 @@ impl GraphicalReportHandler {
535535
fn render_snippets(
536536
&self,
537537
f: &mut impl fmt::Write,
538-
diagnostic: &(dyn Diagnostic),
538+
diagnostic: &dyn Diagnostic,
539539
opt_source: Option<&dyn SourceCode>,
540540
) -> fmt::Result {
541541
let source = match opt_source {
@@ -1361,7 +1361,7 @@ impl GraphicalReportHandler {
13611361
}
13621362

13631363
impl ReportHandler for GraphicalReportHandler {
1364-
fn debug(&self, diagnostic: &(dyn Diagnostic), f: &mut fmt::Formatter<'_>) -> fmt::Result {
1364+
fn debug(&self, diagnostic: &dyn Diagnostic, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13651365
if f.alternate() {
13661366
return fmt::Debug::fmt(diagnostic, f);
13671367
}

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)