From 8cafdb3a99d7e5f91dd89dd83884d964aa6e1fda Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 11 Feb 2019 17:29:20 +0300 Subject: rename combine -> or This way we match API of Option https://doc.rust-lang.org/std/option/enum.Option.html#method.or --- crates/ra_hir/src/nameres.rs | 4 ++-- crates/ra_hir/src/resolve.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir') 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 PerNs { PerNs { types: self.types.as_ref(), values: self.values.as_ref() } } - pub fn combine(self, other: PerNs) -> PerNs { + pub fn or(self, other: PerNs) -> PerNs { 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 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 { pub fn resolve_name(&self, name: &Name) -> PerNs { 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; } -- cgit v1.2.3