Skip to content

Commit

Permalink
fix an ICE on unwrapping a None
Browse files Browse the repository at this point in the history
  • Loading branch information
llogiq committed Dec 25, 2021
1 parent 8529b2a commit 23ffa3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clippy_lints/src/casts/unnecessary_cast.rs
Expand Up @@ -49,8 +49,9 @@ pub(super) fn check(
if cast_from.kind() == cast_to.kind() =>
{
if let Some(src) = snippet_opt(cx, lit.span) {
let num_lit = NumericLiteral::from_lit_kind(&src, &lit.node).unwrap();
lint_unnecessary_cast(cx, expr, num_lit.integer, cast_from, cast_to);
if let Some(num_lit) = NumericLiteral::from_lit_kind(&src, &lit.node) {
lint_unnecessary_cast(cx, expr, num_lit.integer, cast_from, cast_to);
}
}
},
_ => {
Expand Down

0 comments on commit 23ffa3c

Please sign in to comment.