diff options
author | Aleksey Kladov <[email protected]> | 2018-11-27 15:45:16 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-27 15:45:16 +0000 |
commit | aa7fd563a4b8817223ac50fa22cd946ce354f47d (patch) | |
tree | 17537d030ec76cac6c107de165edc522d902b5e5 /crates/ra_analysis/src/descriptors | |
parent | f4860870dae309f5287a287de0aa3a1a1b1de36b (diff) |
use ctry
Diffstat (limited to 'crates/ra_analysis/src/descriptors')
-rw-r--r-- | crates/ra_analysis/src/descriptors/module/mod.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs index 51bc84bf1..764e19ce0 100644 --- a/crates/ra_analysis/src/descriptors/module/mod.rs +++ b/crates/ra_analysis/src/descriptors/module/mod.rs | |||
@@ -17,7 +17,7 @@ use crate::{ | |||
17 | descriptors::{Path, PathKind, DescriptorDatabase}, | 17 | descriptors::{Path, PathKind, DescriptorDatabase}, |
18 | input::SourceRootId, | 18 | input::SourceRootId, |
19 | arena::{Arena, Id}, | 19 | arena::{Arena, Id}, |
20 | loc2id::DefLoc, | 20 | loc2id::{DefLoc, DefId}, |
21 | }; | 21 | }; |
22 | 22 | ||
23 | pub(crate) use self::nameres::ModuleScope; | 23 | pub(crate) use self::nameres::ModuleScope; |
@@ -153,15 +153,6 @@ impl ModuleDescriptor { | |||
153 | db: &impl DescriptorDatabase, | 153 | db: &impl DescriptorDatabase, |
154 | path: Path, | 154 | path: Path, |
155 | ) -> Cancelable<Option<ModuleDescriptor>> { | 155 | ) -> Cancelable<Option<ModuleDescriptor>> { |
156 | macro_rules! ctry { | ||
157 | ($expr:expr) => { | ||
158 | match $expr { | ||
159 | None => return Ok(None), | ||
160 | Some(it) => it, | ||
161 | } | ||
162 | }; | ||
163 | }; | ||
164 | |||
165 | let mut curr = match path.kind { | 156 | let mut curr = match path.kind { |
166 | PathKind::Crate => self.crate_root(), | 157 | PathKind::Crate => self.crate_root(), |
167 | PathKind::Self_ | PathKind::Plain => self.clone(), | 158 | PathKind::Self_ | PathKind::Plain => self.clone(), |