Skip to content

Commit 0f86093

Browse files
committed
Call diag.multipart_suggestion instead
1 parent 4347c55 commit 0f86093

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clippy_lints/src/unnecessary_wrap.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::utils::{
2-
is_type_diagnostic_item, match_qpath, multispan_sugg_with_applicability, paths, return_ty, snippet,
2+
is_type_diagnostic_item, match_qpath, paths, return_ty, snippet,
33
span_lint_and_then,
44
};
55
use if_chain::if_chain;
@@ -102,10 +102,8 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
102102
span,
103103
"this function returns unnecessarily wrapping data",
104104
move |diag| {
105-
multispan_sugg_with_applicability(
106-
diag,
105+
diag.multipart_suggestion(
107106
"factor this out to",
108-
Applicability::MachineApplicable,
109107
suggs.into_iter().chain({
110108
let inner_ty = return_ty(cx, hir_id)
111109
.walk()
@@ -116,7 +114,8 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
116114
_ => None,
117115
});
118116
inner_ty.map(|inner_ty| (fn_decl.output.span(), inner_ty))
119-
}),
117+
}).collect(),
118+
Applicability::MachineApplicable,
120119
);
121120
},
122121
);

0 commit comments

Comments
 (0)