Make some matches exhaustive to avoid bugs, fix tools

This commit is contained in:
Michael Goulet 2023-12-05 21:53:18 +00:00
parent 6ebb66cea9
commit 3ffacf75fe
2 changed files with 2 additions and 0 deletions

View File

@ -275,6 +275,7 @@ fn rewrite_closure_fn_decl(
let coro = match coroutine_kind { let coro = match coroutine_kind {
Some(ast::CoroutineKind::Async { .. }) => "async ", Some(ast::CoroutineKind::Async { .. }) => "async ",
Some(ast::CoroutineKind::Gen { .. }) => "gen ", Some(ast::CoroutineKind::Gen { .. }) => "gen ",
Some(ast::CoroutineKind::AsyncGen { .. }) => "async gen ",
None => "", None => "",
}; };
let mover = if matches!(capture, ast::CaptureBy::Value { .. }) { let mover = if matches!(capture, ast::CaptureBy::Value { .. }) {

View File

@ -79,6 +79,7 @@ pub(crate) fn format_coro(coroutine_kind: &ast::CoroutineKind) -> &'static str {
match coroutine_kind { match coroutine_kind {
ast::CoroutineKind::Async { .. } => "async ", ast::CoroutineKind::Async { .. } => "async ",
ast::CoroutineKind::Gen { .. } => "gen ", ast::CoroutineKind::Gen { .. } => "gen ",
ast::CoroutineKind::AsyncGen { .. } => "async gen ",
} }
} }