diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-27 16:56:38 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-27 16:56:38 +0000 |
commit | 9f08341aa486ea59cb488635f19e960523568fb8 (patch) | |
tree | 160b6aecfabb2f7dac111763b35b6f52ba6ff25b /crates/ra_analysis/src/descriptors/module/nameres.rs | |
parent | 6bb06addf8d5100cd1125c40d3dfa5f7613b42c1 (diff) | |
parent | 192e2bbb0e5c772d43ec61d36de56a0f7062610e (diff) |
Merge #246
246: Resolve path r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module/nameres.rs')
-rw-r--r-- | crates/ra_analysis/src/descriptors/module/nameres.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/nameres.rs b/crates/ra_analysis/src/descriptors/module/nameres.rs index d347a69b0..d2964f67f 100644 --- a/crates/ra_analysis/src/descriptors/module/nameres.rs +++ b/crates/ra_analysis/src/descriptors/module/nameres.rs | |||
@@ -103,7 +103,16 @@ pub(crate) struct ItemMap { | |||
103 | 103 | ||
104 | #[derive(Debug, Default, PartialEq, Eq, Clone)] | 104 | #[derive(Debug, Default, PartialEq, Eq, Clone)] |
105 | pub(crate) struct ModuleScope { | 105 | pub(crate) struct ModuleScope { |
106 | pub(crate) items: FxHashMap<SmolStr, Resolution>, | 106 | items: FxHashMap<SmolStr, Resolution>, |
107 | } | ||
108 | |||
109 | impl ModuleScope { | ||
110 | pub(crate) fn entries<'a>(&'a self) -> impl Iterator<Item = (&'a SmolStr, &Resolution)> + 'a { | ||
111 | self.items.iter() | ||
112 | } | ||
113 | pub(crate) fn get(&self, name: &SmolStr) -> Option<&Resolution> { | ||
114 | self.items.get(name) | ||
115 | } | ||
107 | } | 116 | } |
108 | 117 | ||
109 | /// A set of items and imports declared inside a module, without relation to | 118 | /// A set of items and imports declared inside a module, without relation to |