mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
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:
parent
2a1a80d80c
commit
a2de34720d
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue