Skip to content

Commit

Permalink
Make some matches exhaustive to avoid bugs, fix tools
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Dec 8, 2023
1 parent 6ebb66c commit 3ffacf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/closures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 { .. }) {
Expand Down
1 change: 1 addition & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ",
}
}

Expand Down

0 comments on commit 3ffacf7

Please sign in to comment.