if let TyKind::Path(QPath::Resolved(None, tp)) = &ty.kind;
if let [int] = &*tp.segments;
then {
- let name = &int.ident.name.as_str();
- candidates.iter().find(|c| name == *c).copied()
+ let name = int.ident.name.as_str();
+ candidates.iter().find(|c| &name == *c).copied()
} else {
None
}
if let QPath::Resolved(_, path) = *path;
if let [ty] = &*path.segments;
then {
- let name = &ty.ident.name.as_str();
- INTS.iter().find(|c| name == *c).copied()
+ let name = ty.ident.name.as_str();
+ INTS.iter().find(|c| &name == *c).copied()
} else {
None
}