From 3f796fea9fab0222913f9f895af78b80c4c7660b Mon Sep 17 00:00:00 2001 From: Lukas Tobias Wirth Date: Wed, 5 May 2021 22:55:12 +0200 Subject: simplify --- crates/ide/src/inlay_hints.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'crates/ide') 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( ty: &hir::Type, ) -> Option { let db = sema.db; - let strukt = std::iter::successors(Some(ty.clone()), |ty| ty.remove_ref()) - .last() - .and_then(|strukt| strukt.as_adt())?; + let strukt = ty.strip_references().as_adt()?; let krate = strukt.krate(db); if krate != famous_defs.core()? { return None; -- cgit v1.2.3