Skip to content

Commit 2cfbf1c

Browse files
committed
chore: add debug_assert for precondition
1 parent 39ebb96 commit 2cfbf1c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/closures.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ fn rewrite_closure_block(
241241
context: &RewriteContext<'_>,
242242
shape: Shape,
243243
) -> RewriteResult {
244+
debug_assert!(
245+
matches!(block.kind, ast::ExprKind::Block(..)),
246+
"expected a block expression"
247+
);
248+
244249
Ok(format!(
245250
"{} {}",
246251
prefix,

0 commit comments

Comments
 (0)