aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-02-11 14:30:35 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-02-11 14:30:35 +0000
commit6596793c0ce24b10c599b7d8b34483595d9a4511 (patch)
treedaf3d195a675e44045a843b29b379b7097a170ac
parent821d980fd950679315bb12659a13347233895e67 (diff)
parent8cafdb3a99d7e5f91dd89dd83884d964aa6e1fda (diff)
Merge #787
787: rename combine -> or r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--crates/ra_hir/src/nameres.rs4
-rw-r--r--crates/ra_hir/src/resolve.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs
index 4b8097235..261ebdf97 100644
--- a/crates/ra_hir/src/nameres.rs
+++ b/crates/ra_hir/src/nameres.rs
@@ -135,7 +135,7 @@ impl<T> PerNs<T> {
135 PerNs { types: self.types.as_ref(), values: self.values.as_ref() } 135 PerNs { types: self.types.as_ref(), values: self.values.as_ref() }
136 } 136 }
137 137
138 pub fn combine(self, other: PerNs<T>) -> PerNs<T> { 138 pub fn or(self, other: PerNs<T>) -> PerNs<T> {
139 PerNs { types: self.types.or(other.types), values: self.values.or(other.values) } 139 PerNs { types: self.types.or(other.types), values: self.values.or(other.values) }
140 } 140 }
141 141
@@ -439,7 +439,7 @@ impl ItemMap {
439 let from_extern_prelude = 439 let from_extern_prelude =
440 self.extern_prelude.get(name).map_or(PerNs::none(), |&it| PerNs::types(it)); 440 self.extern_prelude.get(name).map_or(PerNs::none(), |&it| PerNs::types(it));
441 441
442 from_scope.combine(from_extern_prelude) 442 from_scope.or(from_extern_prelude)
443 } 443 }
444 444
445 // Returns Yes if we are sure that additions to `ItemMap` wouldn't change 445 // Returns Yes if we are sure that additions to `ItemMap` wouldn't change
diff --git a/crates/ra_hir/src/resolve.rs b/crates/ra_hir/src/resolve.rs
index e8abac5bc..40c860cf4 100644
--- a/crates/ra_hir/src/resolve.rs
+++ b/crates/ra_hir/src/resolve.rs
@@ -59,7 +59,7 @@ impl Resolver {
59 pub fn resolve_name(&self, name: &Name) -> PerNs<Resolution> { 59 pub fn resolve_name(&self, name: &Name) -> PerNs<Resolution> {
60 let mut resolution = PerNs::none(); 60 let mut resolution = PerNs::none();
61 for scope in self.scopes.iter().rev() { 61 for scope in self.scopes.iter().rev() {
62 resolution = resolution.combine(scope.resolve_name(name)); 62 resolution = resolution.or(scope.resolve_name(name));
63 if resolution.is_both() { 63 if resolution.is_both() {
64 return resolution; 64 return resolution;
65 } 65 }