diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-05 21:56:42 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-05 21:56:42 +0100 |
commit | ecc722de40aaa15a20482759e1f2baf3f745b688 (patch) | |
tree | b8ced23c567c160f9207d52c30e0f08e1aead992 /crates/ide | |
parent | 957760a47f0d0d3275fc2e606f3b204694dc6f21 (diff) | |
parent | 3f796fea9fab0222913f9f895af78b80c4c7660b (diff) |
Merge #8735
8735: simplify r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Tobias Wirth <[email protected]>
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/inlay_hints.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index d5ef054d8..e0bf660c4 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs | |||
@@ -218,9 +218,7 @@ fn hint_iterator( | |||
218 | ty: &hir::Type, | 218 | ty: &hir::Type, |
219 | ) -> Option<SmolStr> { | 219 | ) -> Option<SmolStr> { |
220 | let db = sema.db; | 220 | let db = sema.db; |
221 | let strukt = std::iter::successors(Some(ty.clone()), |ty| ty.remove_ref()) | 221 | let strukt = ty.strip_references().as_adt()?; |
222 | .last() | ||
223 | .and_then(|strukt| strukt.as_adt())?; | ||
224 | let krate = strukt.krate(db); | 222 | let krate = strukt.krate(db); |
225 | if krate != famous_defs.core()? { | 223 | if krate != famous_defs.core()? { |
226 | return None; | 224 | return None; |