mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Run rustfmt
This commit is contained in:
parent
c775856727
commit
a433d4690e
@ -1,7 +1,4 @@
|
||||
use crate::utils::{
|
||||
is_type_diagnostic_item, match_qpath, paths, return_ty, snippet,
|
||||
span_lint_and_then,
|
||||
};
|
||||
use crate::utils::{is_type_diagnostic_item, match_qpath, paths, return_ty, snippet, span_lint_and_then};
|
||||
use if_chain::if_chain;
|
||||
use rustc_errors::Applicability;
|
||||
use rustc_hir::intravisit::{FnKind, Visitor};
|
||||
@ -104,7 +101,9 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
|
||||
move |diag| {
|
||||
diag.multipart_suggestion(
|
||||
"factor this out to",
|
||||
suggs.into_iter().chain({
|
||||
suggs
|
||||
.into_iter()
|
||||
.chain({
|
||||
let inner_ty = return_ty(cx, hir_id)
|
||||
.walk()
|
||||
.skip(1) // skip `std::option::Option` or `std::result::Result`
|
||||
@ -114,7 +113,8 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
|
||||
_ => None,
|
||||
});
|
||||
inner_ty.map(|inner_ty| (fn_decl.output.span(), inner_ty))
|
||||
}).collect(),
|
||||
})
|
||||
.collect(),
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user