chore: appease clippy
This commit is contained in:
parent
c4207af8da
commit
de9ca81b65
2 changed files with 9 additions and 6 deletions
|
@ -3,12 +3,12 @@ use std::process;
|
|||
use ron::error::Position;
|
||||
|
||||
/// Report an `Error` from the `serde_json` crate
|
||||
pub fn report_serde_json_err(src: &str, err: serde_json::Error) -> ! {
|
||||
pub fn report_serde_json_err(src: &str, err: &serde_json::Error) -> ! {
|
||||
report_serde_err(src, err.line(), err.column(), err.to_string())
|
||||
}
|
||||
|
||||
/// Report a `SpannedError` from the `ron` crate
|
||||
pub fn report_serde_ron_err(src: &str, err: ron::error::SpannedError) -> ! {
|
||||
pub fn report_serde_ron_err(src: &str, err: &ron::error::SpannedError) -> ! {
|
||||
let Position { line, col } = err.position;
|
||||
report_serde_err(src, line, col, err.to_string())
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ fn report_serde_err(src: &str, line: usize, col: usize, msg: String) -> ! {
|
|||
.with_message(msg)
|
||||
.with_note("We'd like to give better errors, but serde errors are horrible to work with...")
|
||||
.finish()
|
||||
.print(("test", Source::from(src)))
|
||||
.unwrap();
|
||||
.eprint(("test", Source::from(src)))
|
||||
.expect("writing error to stderr failed");
|
||||
process::exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue