diff options
Diffstat (limited to 'crates/assists/src/handlers')
-rw-r--r-- | crates/assists/src/handlers/convert_integer_literal.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/assists/src/handlers/convert_integer_literal.rs b/crates/assists/src/handlers/convert_integer_literal.rs index 5957834d3..1094ed3f3 100644 --- a/crates/assists/src/handlers/convert_integer_literal.rs +++ b/crates/assists/src/handlers/convert_integer_literal.rs | |||
@@ -14,7 +14,11 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel}; | |||
14 | // const _: i32 = 0b1010; | 14 | // const _: i32 = 0b1010; |
15 | // ``` | 15 | // ``` |
16 | pub(crate) fn convert_integer_literal(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | 16 | pub(crate) fn convert_integer_literal(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { |
17 | let literal = ctx.find_node_at_offset::<ast::Literal>()?.as_int_number()?; | 17 | let literal = ctx.find_node_at_offset::<ast::Literal>()?; |
18 | let literal = match literal.kind() { | ||
19 | ast::LiteralKind::IntNumber(it) => it, | ||
20 | _ => return None, | ||
21 | }; | ||
18 | let radix = literal.radix(); | 22 | let radix = literal.radix(); |
19 | let value = literal.value()?; | 23 | let value = literal.value()?; |
20 | let suffix = literal.suffix(); | 24 | let suffix = literal.suffix(); |