1
Fork 0

eplace usages of vec![].into_iter with [].into_iter

This commit is contained in:
Lucas Kent 2021-12-17 18:36:18 +11:00
parent 23ce5fc465
commit 08829853d3
36 changed files with 116 additions and 122 deletions

View file

@ -1667,10 +1667,10 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
],
Applicability::MachineApplicable,
);
let sugg = vec![sp, cause.span]
let sugg = [sp, cause.span]
.into_iter()
.flat_map(|sp| {
vec![
[
(sp.shrink_to_lo(), "Box::new(".to_string()),
(sp.shrink_to_hi(), ")".to_string()),
]

View file

@ -86,7 +86,7 @@ pub fn determine_parameters_to_be_inferred<'a, 'tcx>(
fn lang_items(tcx: TyCtxt<'_>) -> Vec<(hir::HirId, Vec<ty::Variance>)> {
let lang_items = tcx.lang_items();
let all = vec![
let all = [
(lang_items.phantom_data(), vec![ty::Covariant]),
(lang_items.unsafe_cell_type(), vec![ty::Invariant]),
];