diff options
Diffstat (limited to 'crates/ide/src/inlay_hints.rs')
-rw-r--r-- | crates/ide/src/inlay_hints.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index e2079bbcf..56b985e80 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs | |||
@@ -1,15 +1,14 @@ | |||
1 | use assists::utils::FamousDefs; | 1 | use assists::utils::FamousDefs; |
2 | use either::Either; | ||
2 | use hir::{known, HirDisplay, Semantics}; | 3 | use hir::{known, HirDisplay, Semantics}; |
3 | use ide_db::RootDatabase; | 4 | use ide_db::RootDatabase; |
4 | use stdx::to_lower_snake_case; | 5 | use stdx::to_lower_snake_case; |
5 | use syntax::{ | 6 | use syntax::{ |
6 | ast::{self, ArgListOwner, AstNode}, | 7 | ast::{self, ArgListOwner, AstNode, NameOwner}, |
7 | match_ast, Direction, NodeOrToken, SmolStr, SyntaxKind, TextRange, T, | 8 | match_ast, Direction, NodeOrToken, SmolStr, SyntaxKind, TextRange, T, |
8 | }; | 9 | }; |
9 | 10 | ||
10 | use crate::FileId; | 11 | use crate::FileId; |
11 | use ast::NameOwner; | ||
12 | use either::Either; | ||
13 | 12 | ||
14 | #[derive(Clone, Debug, PartialEq, Eq)] | 13 | #[derive(Clone, Debug, PartialEq, Eq)] |
15 | pub struct InlayHintsConfig { | 14 | pub struct InlayHintsConfig { |
@@ -215,7 +214,7 @@ fn hint_iterator( | |||
215 | .last() | 214 | .last() |
216 | .and_then(|strukt| strukt.as_adt())?; | 215 | .and_then(|strukt| strukt.as_adt())?; |
217 | let krate = strukt.krate(db)?; | 216 | let krate = strukt.krate(db)?; |
218 | if krate.declaration_name(db).as_deref() != Some("core") { | 217 | if krate.display_name(db).as_deref() != Some("core") { |
219 | return None; | 218 | return None; |
220 | } | 219 | } |
221 | let iter_trait = FamousDefs(sema, krate).core_iter_Iterator()?; | 220 | let iter_trait = FamousDefs(sema, krate).core_iter_Iterator()?; |