mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-22 11:24:24 +00:00
simplify
This commit is contained in:
parent
d26fb188c1
commit
3f796fea9f
6 changed files with 38 additions and 39 deletions
|
@ -218,9 +218,7 @@ fn hint_iterator(
|
|||
ty: &hir::Type,
|
||||
) -> Option<SmolStr> {
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue