fix lint errors

This commit is contained in:
Jaeyong Sung 2022-03-05 21:49:36 +09:00
parent 2b0f9aba64
commit c4a3ccde78
No known key found for this signature in database
GPG Key ID: 2B86898CCB2A5486

View File

@ -204,7 +204,7 @@ impl<'tcx> LateLintPass<'tcx> for OnlyUsedInRecursion {
pub fn is_primitive(ty: Ty<'_>) -> bool {
match ty.kind() {
ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Str => true,
ty::Ref(_, t, _) => is_primitive(t),
ty::Ref(_, t, _) => is_primitive(*t),
_ => false,
}
}
@ -212,7 +212,7 @@ pub fn is_primitive(ty: Ty<'_>) -> bool {
pub fn is_array(ty: Ty<'_>) -> bool {
match ty.kind() {
ty::Array(..) | ty::Slice(..) => true,
ty::Ref(_, t, _) => is_array(t),
ty::Ref(_, t, _) => is_array(*t),
_ => false,
}
}