diff options
Diffstat (limited to 'crates/ide_assists')
-rw-r--r-- | crates/ide_assists/src/handlers/add_type_ascription.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_assists/src/handlers/add_type_ascription.rs b/crates/ide_assists/src/handlers/add_type_ascription.rs index ea9f249d3..060c326bf 100644 --- a/crates/ide_assists/src/handlers/add_type_ascription.rs +++ b/crates/ide_assists/src/handlers/add_type_ascription.rs | |||
@@ -9,7 +9,7 @@ use crate::{ | |||
9 | 9 | ||
10 | // Assist: add_type_ascription | 10 | // Assist: add_type_ascription |
11 | // | 11 | // |
12 | // Adds `: _` before the assignment operator to prompt the user for a type | 12 | // Adds `: _` before the assignment operator to prompt the user for a type. |
13 | // | 13 | // |
14 | // ``` | 14 | // ``` |
15 | // fn make<T>() -> T { todo!() } | 15 | // fn make<T>() -> T { todo!() } |
@@ -28,7 +28,7 @@ pub(crate) fn add_type_ascription(acc: &mut Assists, ctx: &AssistContext) -> Opt | |||
28 | let let_stmt = ctx.find_node_at_offset::<ast::LetStmt>()?; | 28 | let let_stmt = ctx.find_node_at_offset::<ast::LetStmt>()?; |
29 | if let_stmt.colon_token().is_some() { | 29 | if let_stmt.colon_token().is_some() { |
30 | mark::hit!(add_type_ascription_already_typed); | 30 | mark::hit!(add_type_ascription_already_typed); |
31 | return None | 31 | return None; |
32 | } | 32 | } |
33 | let type_pos = let_stmt.pat()?.syntax().last_token()?.text_range().end(); | 33 | let type_pos = let_stmt.pat()?.syntax().last_token()?.text_range().end(); |
34 | 34 | ||