From 2a0bfdcd7225f49b67c481cbaa97316b964c2f3e Mon Sep 17 00:00:00 2001 From: Andre Bogus Date: Sun, 12 Feb 2017 14:11:18 +0100 Subject: [PATCH] rustfmt --- clippy_lints/src/ptr.rs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs index 9ea6d18a878..e9176372ebc 100644 --- a/clippy_lints/src/ptr.rs +++ b/clippy_lints/src/ptr.rs @@ -136,22 +136,23 @@ fn check_fn(cx: &LateContext, decl: &FnDecl, fn_id: NodeId) { if let FunctionRetTy::Return(ref ty) = decl.output { if let Some((out, MutMutable, _)) = get_rptr_lm(ty) { let mut immutables = vec![]; - for (_, ref mutbl, ref argspan) in decl.inputs - .iter() - .filter_map(|ty| get_rptr_lm(ty)) - .filter(|&(lt, _, _)| lt.name == out.name) { - if *mutbl == MutMutable { return; } + for (_, ref mutbl, ref argspan) in + decl.inputs + .iter() + .filter_map(|ty| get_rptr_lm(ty)) + .filter(|&(lt, _, _)| lt.name == out.name) { + if *mutbl == MutMutable { + return; + } immutables.push(*argspan); } - if immutables.is_empty() { return; } - span_lint_and_then(cx, - MUT_FROM_REF, - ty.span, - "mutable borrow from immutable input(s)", - |db| { - let ms = MultiSpan::from_spans(immutables); - db.span_note(ms, "immutable borrow here"); - }); + if immutables.is_empty() { + return; + } + span_lint_and_then(cx, MUT_FROM_REF, ty.span, "mutable borrow from immutable input(s)", |db| { + let ms = MultiSpan::from_spans(immutables); + db.span_note(ms, "immutable borrow here"); + }); } } }