mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Remove very useless as_substs
usage from clippy
This commit is contained in:
parent
8f53926232
commit
2ebfbc5753
1 changed files with 1 additions and 1 deletions
|
@ -975,7 +975,7 @@ pub fn approx_ty_size<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> u64 {
|
||||||
}
|
}
|
||||||
match (cx.layout_of(ty).map(|layout| layout.size.bytes()), ty.kind()) {
|
match (cx.layout_of(ty).map(|layout| layout.size.bytes()), ty.kind()) {
|
||||||
(Ok(size), _) => size,
|
(Ok(size), _) => size,
|
||||||
(Err(_), ty::Tuple(list)) => list.as_substs().types().map(|t| approx_ty_size(cx, t)).sum(),
|
(Err(_), ty::Tuple(list)) => list.iter().map(|t| approx_ty_size(cx, t)).sum(),
|
||||||
(Err(_), ty::Array(t, n)) => {
|
(Err(_), ty::Array(t, n)) => {
|
||||||
n.try_eval_target_usize(cx.tcx, cx.param_env).unwrap_or_default() * approx_ty_size(cx, *t)
|
n.try_eval_target_usize(cx.tcx, cx.param_env).unwrap_or_default() * approx_ty_size(cx, *t)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue