Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/keys.rs')
| -rw-r--r-- | crates/hir_def/src/keys.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/hir_def/src/keys.rs b/crates/hir_def/src/keys.rs index 1c9d99eb78..8cd2d77172 100644 --- a/crates/hir_def/src/keys.rs +++ b/crates/hir_def/src/keys.rs @@ -61,4 +61,7 @@ impl<AST: AstNode + 'static, ID: 'static> Policy for AstPtrPolicy<AST, ID> { let key = AstPtr::new(key); map.map.get::<FxHashMap<AstPtr<AST>, ID>>()?.get(&key) } + fn is_empty(map: &DynMap) -> bool { + map.map.get::<FxHashMap<AstPtr<AST>, ID>>().map_or(true, |it| it.is_empty()) + } } |