Remove more unnecessary return keywords.

This commit is contained in:
Nicholas Nethercote 2023-07-31 11:09:12 +10:00
parent f8650114bd
commit d16b1f4a8c

View File

@ -257,7 +257,7 @@ fn expand_macro<'cx>(
// Let the context choose how to interpret the result. // Let the context choose how to interpret the result.
// Weird, but useful for X-macros. // Weird, but useful for X-macros.
return Box::new(ParserAnyMacro { Box::new(ParserAnyMacro {
parser: p, parser: p,
// Pass along the original expansion site and the name of the macro // Pass along the original expansion site and the name of the macro
@ -269,19 +269,18 @@ fn expand_macro<'cx>(
is_trailing_mac: cx.current_expansion.is_trailing_mac, is_trailing_mac: cx.current_expansion.is_trailing_mac,
arm_span, arm_span,
is_local, is_local,
}); })
} }
Err(CanRetry::No(_)) => { Err(CanRetry::No(_)) => {
debug!("Will not retry matching as an error was emitted already"); debug!("Will not retry matching as an error was emitted already");
return DummyResult::any(sp); DummyResult::any(sp)
} }
Err(CanRetry::Yes) => { Err(CanRetry::Yes) => {
// Retry and emit a better error below. // Retry and emit a better error.
}
}
diagnostics::failed_to_match_macro(cx, sp, def_span, name, arg, lhses) diagnostics::failed_to_match_macro(cx, sp, def_span, name, arg, lhses)
} }
}
}
pub(super) enum CanRetry { pub(super) enum CanRetry {
Yes, Yes,