diff options
author | Conrad Ludgate <[email protected]> | 2021-03-01 11:51:52 +0000 |
---|---|---|
committer | Conrad Ludgate <[email protected]> | 2021-03-02 14:30:10 +0000 |
commit | 4a36129c7a018828548e2eddebdd49cdb7d6879d (patch) | |
tree | 9dd7bca3818907cd8d87d908ad3a03fcc68722cc /crates | |
parent | 218390b9fb0cfa713d4b6b38425f3a07fee2b564 (diff) |
chore: fmt + docs
Diffstat (limited to 'crates')
-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 | ||