aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-11-06 21:52:22 +0000
committerAleksey Kladov <[email protected]>2020-11-06 21:52:42 +0000
commit5db789df9c767985a564a31cc593ce7f5964100e (patch)
treed912c15567800abbcaeb04798b8daf9eb1431f7f /crates/assists/src/handlers
parent7f12a1f225c7d3397f27964ce039b55d680772d3 (diff)
Cleanup API
Diffstat (limited to 'crates/assists/src/handlers')
-rw-r--r--crates/assists/src/handlers/convert_integer_literal.rs6
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// ```
16pub(crate) fn convert_integer_literal(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { 16pub(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();