Skip to content

Commit a2de347

Browse files
author
Michael Wright
committed
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.
1 parent 2a1a80d commit a2de347

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/needless_late_init.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ fn assignment_suggestions<'tcx>(
191191
assignment.rhs_span.shrink_to_hi().with_hi(assignment.span.hi()),
192192
]
193193
})
194-
.map(|span| Some((span, String::new())))
195-
.collect::<Option<Vec<(Span, String)>>>()?;
194+
.map(|span| (span, String::new()))
195+
.collect::<Vec<(Span, String)>>();
196196

197197
match suggestions.len() {
198198
// All of `exprs` are never types

0 commit comments

Comments
 (0)