mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Auto merge of #8951 - mikerite:needless-late-init-20220605, r=giraffate
Some refactoring in `needless_late_init` changelog: none
This commit is contained in:
commit
3e771624e1
1 changed files with 7 additions and 7 deletions
|
@ -185,14 +185,14 @@ fn assignment_suggestions<'tcx>(
|
|||
|
||||
let suggestions = assignments
|
||||
.iter()
|
||||
.map(|assignment| Some((assignment.span.until(assignment.rhs_span), String::new())))
|
||||
.chain(assignments.iter().map(|assignment| {
|
||||
Some((
|
||||
.flat_map(|assignment| {
|
||||
[
|
||||
assignment.span.until(assignment.rhs_span),
|
||||
assignment.rhs_span.shrink_to_hi().with_hi(assignment.span.hi()),
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue