needless_late_init refactoring

Remove the unneeded wrapping and unwrapping in suggestion creation.
Collecting to Option<Vec<_>> only returns None if one of the elements is
None and that is never the case here.
This commit is contained in:
Michael Wright 2022-06-05 07:28:28 +02:00
parent 2a1a80d80c
commit a2de34720d

View file

@ -191,8 +191,8 @@ fn assignment_suggestions<'tcx>(
assignment.rhs_span.shrink_to_hi().with_hi(assignment.span.hi()),
]
})
.map(|span| Some((span, String::new())))
.collect::<Option<Vec<(Span, String)>>>()?;
.map(|span| (span, String::new()))
.collect::<Vec<(Span, String)>>();
match suggestions.len() {
// All of `exprs` are never types