mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
Make some matches exhaustive to avoid bugs, fix tools
This commit is contained in:
@@ -275,6 +275,7 @@ fn rewrite_closure_fn_decl(
|
||||
let coro = match coroutine_kind {
|
||||
Some(ast::CoroutineKind::Async { .. }) => "async ",
|
||||
Some(ast::CoroutineKind::Gen { .. }) => "gen ",
|
||||
Some(ast::CoroutineKind::AsyncGen { .. }) => "async gen ",
|
||||
None => "",
|
||||
};
|
||||
let mover = if matches!(capture, ast::CaptureBy::Value { .. }) {
|
||||
|
||||
@@ -79,6 +79,7 @@ pub(crate) fn format_coro(coroutine_kind: &ast::CoroutineKind) -> &'static str {
|
||||
match coroutine_kind {
|
||||
ast::CoroutineKind::Async { .. } => "async ",
|
||||
ast::CoroutineKind::Gen { .. } => "gen ",
|
||||
ast::CoroutineKind::AsyncGen { .. } => "async gen ",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user