diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-21 16:11:21 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-21 16:11:21 +0100 |
commit | 56e61bdfea5454dec4408a4947e037bcd042c886 (patch) | |
tree | 0bc42cbfcf5b6b502ad9fc3079cb4bdc5e8f110f /crates/hir_def/src/nameres.rs | |
parent | 25bf451c8426a68ecfdc3a1d1be1db9702dd41d8 (diff) | |
parent | 47747cd4120e260a144242aadd7732e11d133fe4 (diff) |
Merge #9165
9165: Apply some clippy suggestions r=matklad a=clemenswasser
Co-authored-by: Clemens Wasser <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres.rs')
-rw-r--r-- | crates/hir_def/src/nameres.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index ebfcc26c4..9e6aa9607 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs | |||
@@ -367,10 +367,7 @@ impl DefMap { | |||
367 | pub fn containing_module(&self, local_mod: LocalModuleId) -> Option<ModuleId> { | 367 | pub fn containing_module(&self, local_mod: LocalModuleId) -> Option<ModuleId> { |
368 | match &self[local_mod].parent { | 368 | match &self[local_mod].parent { |
369 | Some(parent) => Some(self.module_id(*parent)), | 369 | Some(parent) => Some(self.module_id(*parent)), |
370 | None => match &self.block { | 370 | None => self.block.as_ref().map(|block| block.parent), |
371 | Some(block) => Some(block.parent), | ||
372 | None => None, | ||
373 | }, | ||
374 | } | 371 | } |
375 | } | 372 | } |
376 | 373 | ||