aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-09-12 21:35:53 +0100
committerAleksey Kladov <[email protected]>2019-09-13 14:24:10 +0100
commit51e2d76b9839410020c75ac02ad602675b0a5aa9 (patch)
tree989afd660d62db28196a8792cec2affb7bfd50a7 /crates/ra_hir/src/nameres
parent1adf0519bcc8286c06e12aa7e5b16298addfea4a (diff)
Specify desirable namespace when calling resolve
That way, we are able to get rid of a number of unreachable statements
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/per_ns.rs9
1 files changed, 0 insertions, 9 deletions
diff --git a/crates/ra_hir/src/nameres/per_ns.rs b/crates/ra_hir/src/nameres/per_ns.rs
index d07cc08f4..b0f4dff33 100644
--- a/crates/ra_hir/src/nameres/per_ns.rs
+++ b/crates/ra_hir/src/nameres/per_ns.rs
@@ -68,10 +68,6 @@ impl<T> PerNs<T> {
68 PerNs { types: None, values: None, macros: self.macros } 68 PerNs { types: None, values: None, macros: self.macros }
69 } 69 }
70 70
71 pub fn as_ref(&self) -> PerNs<&T> {
72 PerNs { types: self.types.as_ref(), values: self.values.as_ref(), macros: self.macros }
73 }
74
75 pub fn or(self, other: PerNs<T>) -> PerNs<T> { 71 pub fn or(self, other: PerNs<T>) -> PerNs<T> {
76 PerNs { 72 PerNs {
77 types: self.types.or(other.types), 73 types: self.types.or(other.types),
@@ -79,9 +75,4 @@ impl<T> PerNs<T> {
79 macros: self.macros.or(other.macros), 75 macros: self.macros.or(other.macros),
80 } 76 }
81 } 77 }
82
83 /// Map types and values. Leave macros unchanged.
84 pub fn map<U>(self, f: impl Fn(T) -> U) -> PerNs<U> {
85 PerNs { types: self.types.map(&f), values: self.values.map(&f), macros: self.macros }
86 }
87} 78}