Used clippy to clean itself
This commit is contained in:
parent
5e20475e47
commit
5150277a4f
19 changed files with 67 additions and 154 deletions
|
|
@ -2461,11 +2461,7 @@ fn derefs_to_slice<'tcx>(
|
|||
ty::Adt(def, _) if def.is_box() => may_slice(cx, ty.boxed_ty()),
|
||||
ty::Adt(..) => is_type_diagnostic_item(cx, ty, sym!(vec_type)),
|
||||
ty::Array(_, size) => {
|
||||
if let Some(size) = size.try_eval_usize(cx.tcx, cx.param_env) {
|
||||
size < 32
|
||||
} else {
|
||||
false
|
||||
}
|
||||
size.try_eval_usize(cx.tcx, cx.param_env).map_or(false, |size| size < 32)
|
||||
},
|
||||
ty::Ref(_, inner, _) => may_slice(cx, inner),
|
||||
_ => false,
|
||||
|
|
|
|||
|
|
@ -78,11 +78,7 @@ fn check_expression<'tcx>(cx: &LateContext<'tcx>, arg_id: hir::HirId, expr: &'tc
|
|||
(true, true)
|
||||
},
|
||||
hir::ExprKind::Block(ref block, _) => {
|
||||
if let Some(expr) = &block.expr {
|
||||
check_expression(cx, arg_id, &expr)
|
||||
} else {
|
||||
(false, false)
|
||||
}
|
||||
block.expr.as_ref().map_or((false, false), |expr| check_expression(cx, arg_id, &expr))
|
||||
},
|
||||
hir::ExprKind::Match(_, arms, _) => {
|
||||
let mut found_mapping = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue