Re-format let-else per rustfmt update
This commit is contained in:
@@ -203,14 +203,18 @@ impl<'a> DiagnosticDeriveVariantBuilder<'a> {
|
||||
if first && (nested.input.is_empty() || nested.input.peek(Token![,])) {
|
||||
self.slug.set_once(path.clone(), path.span().unwrap());
|
||||
first = false;
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
first = false;
|
||||
|
||||
let Ok(nested) = nested.value() else {
|
||||
span_err(nested.input.span().unwrap(), "diagnostic slug must be the first argument").emit();
|
||||
return Ok(())
|
||||
span_err(
|
||||
nested.input.span().unwrap(),
|
||||
"diagnostic slug must be the first argument",
|
||||
)
|
||||
.emit();
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
if path.is_ident("code") {
|
||||
@@ -221,7 +225,9 @@ impl<'a> DiagnosticDeriveVariantBuilder<'a> {
|
||||
#diag.code(rustc_errors::DiagnosticId::Error(#code.to_string()));
|
||||
});
|
||||
} else {
|
||||
span_err(path.span().unwrap(), "unknown argument").note("only the `code` parameter is valid after the slug").emit();
|
||||
span_err(path.span().unwrap(), "unknown argument")
|
||||
.note("only the `code` parameter is valid after the slug")
|
||||
.emit();
|
||||
|
||||
// consume the buffer so we don't have syntax errors from syn
|
||||
let _ = nested.parse::<TokenStream>();
|
||||
|
||||
@@ -188,7 +188,9 @@ impl<'parent, 'a> SubdiagnosticDeriveVariantBuilder<'parent, 'a> {
|
||||
let mut kind_slugs = vec![];
|
||||
|
||||
for attr in self.variant.ast().attrs {
|
||||
let Some(SubdiagnosticVariant { kind, slug, no_span }) = SubdiagnosticVariant::from_attr(attr, self)? else {
|
||||
let Some(SubdiagnosticVariant { kind, slug, no_span }) =
|
||||
SubdiagnosticVariant::from_attr(attr, self)?
|
||||
else {
|
||||
// Some attributes aren't errors - like documentation comments - but also aren't
|
||||
// subdiagnostics.
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user