mirror of https://github.com/zkat/miette.git
misc: cargo fmt
This commit is contained in:
parent
5fd2765bf0
commit
b5c4118e59
|
|
@ -94,7 +94,12 @@ impl DefaultReportPrinter {
|
||||||
} else {
|
} else {
|
||||||
self.theme.characters.lbot
|
self.theme.characters.lbot
|
||||||
};
|
};
|
||||||
let msg = format!(" {}{}{} {}", char, self.theme.characters.hbar, self.theme.characters.rarrow, error).style(severity_style).to_string();
|
let msg = format!(
|
||||||
|
" {}{}{} {}",
|
||||||
|
char, self.theme.characters.hbar, self.theme.characters.rarrow, error
|
||||||
|
)
|
||||||
|
.style(severity_style)
|
||||||
|
.to_string();
|
||||||
writeln!(f, "{}", msg)?;
|
writeln!(f, "{}", msg)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,11 @@ impl MietteStyles {
|
||||||
code: style().yellow(),
|
code: style().yellow(),
|
||||||
help: style().cyan(),
|
help: style().cyan(),
|
||||||
filename: style().cyan().underline().bold(),
|
filename: style().cyan().underline().bold(),
|
||||||
highlights: vec![style().red().bold(), style().yellow().bold(), style().cyan().bold()],
|
highlights: vec![
|
||||||
|
style().red().bold(),
|
||||||
|
style().yellow().bold(),
|
||||||
|
style().cyan().bold(),
|
||||||
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,9 @@ fn single_line_highlight() -> Result<(), MietteError> {
|
||||||
3 │ here
|
3 │ here
|
||||||
|
|
||||||
‽ try doing it better next time?
|
‽ try doing it better next time?
|
||||||
"#.trim_start().to_string();
|
"#
|
||||||
|
.trim_start()
|
||||||
|
.to_string();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +94,9 @@ fn single_line_highlight_no_label() -> Result<(), MietteError> {
|
||||||
3 │ here
|
3 │ here
|
||||||
|
|
||||||
‽ try doing it better next time?
|
‽ try doing it better next time?
|
||||||
"#.trim_start().to_string();
|
"#
|
||||||
|
.trim_start()
|
||||||
|
.to_string();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -136,7 +140,9 @@ fn multiple_same_line_highlights() -> Result<(), MietteError> {
|
||||||
3 │ here
|
3 │ here
|
||||||
|
|
||||||
‽ try doing it better next time?
|
‽ try doing it better next time?
|
||||||
"#.trim_start().to_string();
|
"#
|
||||||
|
.trim_start()
|
||||||
|
.to_string();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -175,7 +181,9 @@ fn multiline_highlight_adjacent() -> Result<(), MietteError> {
|
||||||
· ╰──── these two lines
|
· ╰──── these two lines
|
||||||
|
|
||||||
‽ try doing it better next time?
|
‽ try doing it better next time?
|
||||||
"#.trim_start().to_string();
|
"#
|
||||||
|
.trim_start()
|
||||||
|
.to_string();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -211,7 +219,7 @@ line5
|
||||||
};
|
};
|
||||||
let out = fmt_report(err.into());
|
let out = fmt_report(err.into());
|
||||||
println!("{}", out);
|
println!("{}", out);
|
||||||
let expected =r#"
|
let expected = r#"
|
||||||
────[oops::my::bad]────────────────────
|
────[oops::my::bad]────────────────────
|
||||||
|
|
||||||
× oops!
|
× oops!
|
||||||
|
|
@ -226,7 +234,9 @@ line5
|
||||||
· ╰───── block 1
|
· ╰───── block 1
|
||||||
|
|
||||||
‽ try doing it better next time?
|
‽ try doing it better next time?
|
||||||
"#.trim_start().to_string();
|
"#
|
||||||
|
.trim_start()
|
||||||
|
.to_string();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -276,7 +286,9 @@ line5
|
||||||
· ╰───── block 1
|
· ╰───── block 1
|
||||||
|
|
||||||
‽ try doing it better next time?
|
‽ try doing it better next time?
|
||||||
"#.trim_start().to_string();
|
"#
|
||||||
|
.trim_start()
|
||||||
|
.to_string();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -306,7 +318,7 @@ fn multiple_multiline_highlights_adjacent() -> Result<(), MietteError> {
|
||||||
};
|
};
|
||||||
let out = fmt_report(err.into());
|
let out = fmt_report(err.into());
|
||||||
println!("{}", out);
|
println!("{}", out);
|
||||||
let expected =r#"
|
let expected = r#"
|
||||||
────[oops::my::bad]────────────────────
|
────[oops::my::bad]────────────────────
|
||||||
|
|
||||||
× oops!
|
× oops!
|
||||||
|
|
@ -320,7 +332,9 @@ fn multiple_multiline_highlights_adjacent() -> Result<(), MietteError> {
|
||||||
· ╰──── also this bit
|
· ╰──── also this bit
|
||||||
|
|
||||||
‽ try doing it better next time?
|
‽ try doing it better next time?
|
||||||
"#.trim_start().to_string();
|
"#
|
||||||
|
.trim_start()
|
||||||
|
.to_string();
|
||||||
assert_eq!(expected, out);
|
assert_eq!(expected, out);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue