From 2df0161973ee47095b4082c6869760fa489b556b Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Thu, 11 May 2017 12:37:32 +0100 Subject: [PATCH] clean tests/ui/let_if_seq.rs Cleaning the empty lines for clarity. --- tests/ui/let_if_seq.rs | 14 ----------- tests/ui/let_if_seq.stderr | 51 ++++++++++++++++---------------------- 2 files changed, 22 insertions(+), 43 deletions(-) diff --git a/tests/ui/let_if_seq.rs b/tests/ui/let_if_seq.rs index 9e221cc5b..2e9edea00 100644 --- a/tests/ui/let_if_seq.rs +++ b/tests/ui/let_if_seq.rs @@ -55,17 +55,11 @@ fn main() { issue985_alt(); let mut foo = 0; - - - if f() { foo = 42; } let mut bar = 0; - - - if f() { f(); bar = 42; @@ -75,10 +69,6 @@ fn main() { } let quz; - - - - if f() { quz = 42; } else { @@ -87,7 +77,6 @@ fn main() { // `toto` is used several times let mut toto; - if f() { toto = 42; } else { @@ -109,9 +98,6 @@ fn main() { // baz needs to be mut let mut baz = 0; - - - if f() { baz = 42; } diff --git a/tests/ui/let_if_seq.stderr b/tests/ui/let_if_seq.stderr index c080c54d0..ea3c820dd 100644 --- a/tests/ui/let_if_seq.stderr +++ b/tests/ui/let_if_seq.stderr @@ -2,12 +2,9 @@ error: `if _ { .. } else { .. }` is an expression --> $DIR/let_if_seq.rs:57:5 | 57 | / let mut foo = 0; -58 | | -59 | | -60 | | -61 | | if f() { -62 | | foo = 42; -63 | | } +58 | | if f() { +59 | | foo = 42; +60 | | } | |_____^ help: it is more idiomatic to write `let foo = if f() { 42 } else { 0 };` | note: lint level defined here @@ -18,41 +15,37 @@ note: lint level defined here = note: you might not need `mut` at all error: `if _ { .. } else { .. }` is an expression - --> $DIR/let_if_seq.rs:65:5 + --> $DIR/let_if_seq.rs:62:5 | -65 | / let mut bar = 0; -66 | | -67 | | -68 | | +62 | / let mut bar = 0; +63 | | if f() { +64 | | f(); +65 | | bar = 42; ... | -74 | | f(); -75 | | } +68 | | f(); +69 | | } | |_____^ help: it is more idiomatic to write `let bar = if f() { ..; 42 } else { ..; 0 };` | = note: you might not need `mut` at all error: `if _ { .. } else { .. }` is an expression - --> $DIR/let_if_seq.rs:77:5 + --> $DIR/let_if_seq.rs:71:5 | -77 | / let quz; -78 | | -79 | | -80 | | -... | -85 | | quz = 0; -86 | | } +71 | / let quz; +72 | | if f() { +73 | | quz = 42; +74 | | } else { +75 | | quz = 0; +76 | | } | |_____^ help: it is more idiomatic to write `let quz = if f() { 42 } else { 0 };` error: `if _ { .. } else { .. }` is an expression - --> $DIR/let_if_seq.rs:111:5 + --> $DIR/let_if_seq.rs:100:5 | -111 | / let mut baz = 0; -112 | | -113 | | -114 | | -115 | | if f() { -116 | | baz = 42; -117 | | } +100 | / let mut baz = 0; +101 | | if f() { +102 | | baz = 42; +103 | | } | |_____^ help: it is more idiomatic to write `let baz = if f() { 42 } else { 0 };` | = note: you might not need `mut` at all