about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Wright <mikerite@lavabit.com>2022-06-05 07:28:28 +0200
committerMichael Wright <mikerite@lavabit.com>2022-06-05 07:30:59 +0200
commita2de34720d984669499e981b640cde050c2a4dfa (patch)
treebff5a53fade5f5083f7c6f51a5acd8876a76851e
parent2a1a80d80cdc75ed0bb9f35744591089b8a89f31 (diff)
downloadrust-a2de34720d984669499e981b640cde050c2a4dfa.tar.gz
rust-a2de34720d984669499e981b640cde050c2a4dfa.zip
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.
-rw-r--r--clippy_lints/src/needless_late_init.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/needless_late_init.rs b/clippy_lints/src/needless_late_init.rs
index 5e97c606e21..4154c71b428 100644
--- a/clippy_lints/src/needless_late_init.rs
+++ b/clippy_lints/src/needless_late_init.rs
@@ -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