diff options
author | Aleksey Kladov <[email protected]> | 2019-01-15 18:09:51 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-15 18:09:51 +0000 |
commit | 0bb170a277582f5f17c21cddd27a11f19750fa36 (patch) | |
tree | b97ae214a8616def416b64fb07287ac66554ed3a /crates/ra_ide_api/src/completion/complete_path.rs | |
parent | 05ba45c667454028c3e65769d6f63fb0f27c1ca8 (diff) |
remove Canceled from impl of ra_ide_api
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_path.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_path.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index 42468681a..1eded7658 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs | |||
@@ -1,16 +1,15 @@ | |||
1 | use crate::{ | 1 | use crate::{ |
2 | Cancelable, | ||
3 | completion::{CompletionItem, CompletionItemKind, Completions, CompletionKind, CompletionContext}, | 2 | completion::{CompletionItem, CompletionItemKind, Completions, CompletionKind, CompletionContext}, |
4 | }; | 3 | }; |
5 | 4 | ||
6 | pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) -> Cancelable<()> { | 5 | pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { |
7 | let (path, module) = match (&ctx.path_prefix, &ctx.module) { | 6 | let (path, module) = match (&ctx.path_prefix, &ctx.module) { |
8 | (Some(path), Some(module)) => (path.clone(), module), | 7 | (Some(path), Some(module)) => (path.clone(), module), |
9 | _ => return Ok(()), | 8 | _ => return, |
10 | }; | 9 | }; |
11 | let def_id = match module.resolve_path(ctx.db, &path).take_types() { | 10 | let def_id = match module.resolve_path(ctx.db, &path).take_types() { |
12 | Some(it) => it, | 11 | Some(it) => it, |
13 | None => return Ok(()), | 12 | None => return, |
14 | }; | 13 | }; |
15 | match def_id.resolve(ctx.db) { | 14 | match def_id.resolve(ctx.db) { |
16 | hir::Def::Module(module) => { | 15 | hir::Def::Module(module) => { |
@@ -30,9 +29,8 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) -> C | |||
30 | .add_to(acc) | 29 | .add_to(acc) |
31 | }); | 30 | }); |
32 | } | 31 | } |
33 | _ => return Ok(()), | 32 | _ => return, |
34 | }; | 33 | }; |
35 | Ok(()) | ||
36 | } | 34 | } |
37 | 35 | ||
38 | #[cfg(test)] | 36 | #[cfg(test)] |