Skip to content

Commit 342cd19

Browse files
committed
Add safety comment
1 parent 4a2c4aa commit 342cd19

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

parser/src/python.lalrpop

+1
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ MatchStatement: ast::Stmt = {
388388

389389
MatchCase: ast::MatchCase = {
390390
<start:@L> "case" <pattern:Patterns> <guard:(Guard)?> ":" <body:Suite> => {
391+
// SAFETY: `body` is never empty because it is non-optional and `Suite` matches one or more statements.
391392
let end = body.last().unwrap().end();
392393
ast::MatchCase {
393394
pattern,

parser/src/python.rs

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)