787: rename combine -> or r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2019-02-11 14:30:35 +00:00
commit 6596793c0c
2 changed files with 3 additions and 3 deletions

View File

@ -135,7 +135,7 @@ impl<T> PerNs<T> {
PerNs { types: self.types.as_ref(), values: self.values.as_ref() }
}
pub fn combine(self, other: PerNs<T>) -> PerNs<T> {
pub fn or(self, other: PerNs<T>) -> PerNs<T> {
PerNs { types: self.types.or(other.types), values: self.values.or(other.values) }
}
@ -439,7 +439,7 @@ impl ItemMap {
let from_extern_prelude =
self.extern_prelude.get(name).map_or(PerNs::none(), |&it| PerNs::types(it));
from_scope.combine(from_extern_prelude)
from_scope.or(from_extern_prelude)
}
// Returns Yes if we are sure that additions to `ItemMap` wouldn't change

View File

@ -59,7 +59,7 @@ impl Resolver {
pub fn resolve_name(&self, name: &Name) -> PerNs<Resolution> {
let mut resolution = PerNs::none();
for scope in self.scopes.iter().rev() {
resolution = resolution.combine(scope.resolve_name(name));
resolution = resolution.or(scope.resolve_name(name));
if resolution.is_both() {
return resolution;
}