diff options
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/imp.rs | 10 | ||||
-rw-r--r-- | crates/ra_ide_api/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_api/src/runnables.rs | 1 |
3 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_ide_api/src/imp.rs b/crates/ra_ide_api/src/imp.rs index 76cb312dd..3ef11dfa1 100644 --- a/crates/ra_ide_api/src/imp.rs +++ b/crates/ra_ide_api/src/imp.rs | |||
@@ -99,16 +99,16 @@ impl db::RootDatabase { | |||
99 | 99 | ||
100 | impl db::RootDatabase { | 100 | impl db::RootDatabase { |
101 | /// Returns `Vec` for the same reason as `parent_module` | 101 | /// Returns `Vec` for the same reason as `parent_module` |
102 | pub(crate) fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> { | 102 | pub(crate) fn crate_for(&self, file_id: FileId) -> Vec<CrateId> { |
103 | let module = match source_binder::module_from_file_id(self, file_id) { | 103 | let module = match source_binder::module_from_file_id(self, file_id) { |
104 | Some(it) => it, | 104 | Some(it) => it, |
105 | None => return Ok(Vec::new()), | 105 | None => return Vec::new(), |
106 | }; | 106 | }; |
107 | let krate = match module.krate(self)? { | 107 | let krate = match module.krate(self) { |
108 | Some(it) => it, | 108 | Some(it) => it, |
109 | None => return Ok(Vec::new()), | 109 | None => return Vec::new(), |
110 | }; | 110 | }; |
111 | Ok(vec![krate.crate_id()]) | 111 | vec![krate.crate_id()] |
112 | } | 112 | } |
113 | pub(crate) fn find_all_refs( | 113 | pub(crate) fn find_all_refs( |
114 | &self, | 114 | &self, |
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index e0b8410d1..0f690fc84 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -419,7 +419,7 @@ impl Analysis { | |||
419 | 419 | ||
420 | /// Returns crates this file belongs too. | 420 | /// Returns crates this file belongs too. |
421 | pub fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> { | 421 | pub fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> { |
422 | self.with_db(|db| db.crate_for(file_id))? | 422 | self.with_db(|db| db.crate_for(file_id)) |
423 | } | 423 | } |
424 | 424 | ||
425 | /// Returns the root file of the given crate. | 425 | /// Returns the root file of the given crate. |
diff --git a/crates/ra_ide_api/src/runnables.rs b/crates/ra_ide_api/src/runnables.rs index c0d4bda94..a3207fdd2 100644 --- a/crates/ra_ide_api/src/runnables.rs +++ b/crates/ra_ide_api/src/runnables.rs | |||
@@ -80,7 +80,6 @@ fn runnable_mod(db: &RootDatabase, file_id: FileId, module: &ast::Module) -> Opt | |||
80 | // FIXME: thread cancellation instead of `.ok`ing | 80 | // FIXME: thread cancellation instead of `.ok`ing |
81 | let path = module | 81 | let path = module |
82 | .path_to_root(db) | 82 | .path_to_root(db) |
83 | .ok()? | ||
84 | .into_iter() | 83 | .into_iter() |
85 | .rev() | 84 | .rev() |
86 | .filter_map(|it| it.name(db)) | 85 | .filter_map(|it| it.name(db)) |