fmt: cargo fmt --all

This commit is contained in:
Kat Marchán 2021-08-15 21:08:53 -07:00
parent 991a93619b
commit 3e5ee0ee4d
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
4 changed files with 8 additions and 16 deletions

View File

@ -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();

View File

@ -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",
))
}
}
}

View File

@ -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."))
}
}
}

View File

@ -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());
}