Skip to content

Commit 31adcd6

Browse files
committed
fix(clippy): replace let-then-return and unreachable!() with explicit error
1 parent acdbda2 commit 31adcd6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/parser/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7229,8 +7229,7 @@ impl<'a> Parser<'a> {
72297229
self.prev_token();
72307230
vec![]
72317231
} else {
7232-
let parsed = self.parse_comma_separated(|p| p.parse_data_type())?;
7233-
parsed
7232+
self.parse_comma_separated(|p| p.parse_data_type())?
72347233
};
72357234
self.expect_token(&Token::RParen)?;
72367235

@@ -7369,7 +7368,11 @@ impl<'a> Parser<'a> {
73697368
Keyword::SAFE => FunctionParallel::Safe,
73707369
Keyword::RESTRICTED => FunctionParallel::Restricted,
73717370
Keyword::UNSAFE => FunctionParallel::Unsafe,
7372-
_ => unreachable!(),
7371+
unexpected_keyword => {
7372+
return Err(ParserError::ParserError(format!(
7373+
"Internal parser error: unexpected keyword `{unexpected_keyword}` in PARALLEL"
7374+
)))
7375+
}
73737376
};
73747377
Ok(CreateAggregateOption::Parallel(parallel))
73757378
}

0 commit comments

Comments
 (0)