diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-06 21:54:14 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-06 21:54:14 +0000 |
commit | c365329911bfb33410da0363a4783f102094283f (patch) | |
tree | d912c15567800abbcaeb04798b8daf9eb1431f7f /crates/assists/src/handlers | |
parent | 7f12a1f225c7d3397f27964ce039b55d680772d3 (diff) | |
parent | 5db789df9c767985a564a31cc593ce7f5964100e (diff) |
Merge #6486
6486: Cleanup API r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
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(); |