aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/visibility.rs
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-17 16:37:14 +0100
committerLukas Wirth <[email protected]>2021-06-17 16:37:14 +0100
commit95c8c65139c10e4de44367fead8dff88511e6d46 (patch)
tree4326d46ee282c133123f3a08aaee7d640f007050 /crates/hir_def/src/visibility.rs
parentc82a9141abe6b6cbf5b55710dc8a315a3839081b (diff)
Nest all the or-patterns!
Diffstat (limited to 'crates/hir_def/src/visibility.rs')
-rw-r--r--crates/hir_def/src/visibility.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/hir_def/src/visibility.rs b/crates/hir_def/src/visibility.rs
index 83500f54e..aeb1e7726 100644
--- a/crates/hir_def/src/visibility.rs
+++ b/crates/hir_def/src/visibility.rs
@@ -172,9 +172,8 @@ impl Visibility {
172 /// visible in unrelated modules). 172 /// visible in unrelated modules).
173 pub(crate) fn max(self, other: Visibility, def_map: &DefMap) -> Option<Visibility> { 173 pub(crate) fn max(self, other: Visibility, def_map: &DefMap) -> Option<Visibility> {
174 match (self, other) { 174 match (self, other) {
175 (Visibility::Module(_), Visibility::Public) 175 (Visibility::Module(_) | Visibility::Public, Visibility::Public)
176 | (Visibility::Public, Visibility::Module(_)) 176 | (Visibility::Public, Visibility::Module(_)) => Some(Visibility::Public),
177 | (Visibility::Public, Visibility::Public) => Some(Visibility::Public),
178 (Visibility::Module(mod_a), Visibility::Module(mod_b)) => { 177 (Visibility::Module(mod_a), Visibility::Module(mod_b)) => {
179 if mod_a.krate != mod_b.krate { 178 if mod_a.krate != mod_b.krate {
180 return None; 179 return None;