mirror of https://github.com/zkat/miette.git
fmt: cargo fmt --all
This commit is contained in:
parent
991a93619b
commit
3e5ee0ee4d
|
|
@ -50,9 +50,7 @@ impl Diagnostic {
|
|||
DiagnosticArg::Severity(sev) => {
|
||||
severity = Some(sev);
|
||||
}
|
||||
DiagnosticArg::Help(hl) => {
|
||||
help = Some(hl)
|
||||
}
|
||||
DiagnosticArg::Help(hl) => help = Some(hl),
|
||||
}
|
||||
}
|
||||
let ident = input.ident.clone();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,10 @@ impl Parse for DiagnosticArg {
|
|||
} else if ident == "help" {
|
||||
Ok(DiagnosticArg::Help(input.parse()?))
|
||||
} else {
|
||||
Err(syn::Error::new(ident.span(), "Unrecognized diagnostic option"))
|
||||
Err(syn::Error::new(
|
||||
ident.span(),
|
||||
"Unrecognized diagnostic option",
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,10 +31,7 @@ impl Parse for Severity {
|
|||
Ok(Severity(input.parse::<syn::LitStr>()?.parse()?))
|
||||
}
|
||||
} else {
|
||||
Err(syn::Error::new(
|
||||
ident.span(),
|
||||
"not a severity level.",
|
||||
))
|
||||
Err(syn::Error::new(ident.span(), "not a severity level."))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,15 +150,9 @@ fn fmt_help() {
|
|||
#[derive(Debug, Diagnostic, Error)]
|
||||
#[error("welp")]
|
||||
enum FooEnum {
|
||||
#[diagnostic(
|
||||
code(foo::x),
|
||||
help("{} {}", 1, "bar"),
|
||||
)]
|
||||
#[diagnostic(code(foo::x), help("{} {}", 1, "bar"))]
|
||||
X,
|
||||
}
|
||||
|
||||
assert_eq!(
|
||||
"1 bar".to_string(),
|
||||
FooEnum::X.help().unwrap().to_string()
|
||||
);
|
||||
assert_eq!("1 bar".to_string(), FooEnum::X.help().unwrap().to_string());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue