Skip to content

Commit 5c32c71

Browse files
committed
Run rustfmt
1 parent 0f86093 commit 5c32c71

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

clippy_lints/src/unnecessary_wrap.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use crate::utils::{
2-
is_type_diagnostic_item, match_qpath, paths, return_ty, snippet,
3-
span_lint_and_then,
4-
};
1+
use crate::utils::{is_type_diagnostic_item, match_qpath, paths, return_ty, snippet, span_lint_and_then};
52
use if_chain::if_chain;
63
use rustc_errors::Applicability;
74
use rustc_hir::intravisit::{FnKind, Visitor};
@@ -104,17 +101,20 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
104101
move |diag| {
105102
diag.multipart_suggestion(
106103
"factor this out to",
107-
suggs.into_iter().chain({
108-
let inner_ty = return_ty(cx, hir_id)
109-
.walk()
110-
.skip(1) // skip `std::option::Option` or `std::result::Result`
111-
.take(1) // take the first outermost inner type
112-
.filter_map(|inner| match inner.unpack() {
113-
GenericArgKind::Type(inner_ty) => Some(inner_ty.to_string()),
114-
_ => None,
115-
});
116-
inner_ty.map(|inner_ty| (fn_decl.output.span(), inner_ty))
117-
}).collect(),
104+
suggs
105+
.into_iter()
106+
.chain({
107+
let inner_ty = return_ty(cx, hir_id)
108+
.walk()
109+
.skip(1) // skip `std::option::Option` or `std::result::Result`
110+
.take(1) // take the first outermost inner type
111+
.filter_map(|inner| match inner.unpack() {
112+
GenericArgKind::Type(inner_ty) => Some(inner_ty.to_string()),
113+
_ => None,
114+
});
115+
inner_ty.map(|inner_ty| (fn_decl.output.span(), inner_ty))
116+
})
117+
.collect(),
118118
Applicability::MachineApplicable,
119119
);
120120
},

0 commit comments

Comments
 (0)