blob: ca378fa43232789fc59fa652a90383c618872ad0 [file] [log] [blame]
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:13:5
|
LL | let x = 5;
| ---------- unnecessary `let` binding
LL | x
| ^
|
= note: `-D clippy::let-and-return` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::let_and_return)]`
help: return the expression directly
|
LL ~
LL ~ 5
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:20:9
|
LL | let x = 5;
| ---------- unnecessary `let` binding
LL | x
| ^
|
help: return the expression directly
|
LL ~
LL ~ 5
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:83:5
|
LL | let line = stdin.lock().lines().next().unwrap().unwrap();
| --------------------------------------------------------- unnecessary `let` binding
LL | line
| ^^^^
|
help: return the expression directly
|
LL ~
LL ~ stdin.lock().lines().next().unwrap().unwrap()
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:106:9
|
LL | let ret = value.borrow().baz();
| ------------------------------- unnecessary `let` binding
LL | ret
| ^^^
|
help: return the expression directly
|
LL ~
LL ~ value.borrow().baz()
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:117:9
|
LL | let ret = f(|| value.borrow().baz())();
| --------------------------------------- unnecessary `let` binding
LL | ret
| ^^^
|
help: return the expression directly
|
LL ~
LL ~ f(|| value.borrow().baz())()
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:149:13
|
LL | let value = some_foo(&x).value();
| --------------------------------- unnecessary `let` binding
LL | value
| ^^^^^
|
help: return the expression directly
|
LL ~
LL ~ some_foo(&x).value()
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:156:13
|
LL | let value = Foo::new(&x).value();
| --------------------------------- unnecessary `let` binding
LL | value
| ^^^^^
|
help: return the expression directly
|
LL ~
LL ~ Foo::new(&x).value()
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:178:13
|
LL | let clone = Arc::clone(&self.foo);
| ---------------------------------- unnecessary `let` binding
LL | clone
| ^^^^^
|
help: return the expression directly
|
LL ~
LL ~ (Arc::clone(&self.foo)) as _
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:197:13
|
LL | / let result = match self {
LL | | E::A(x) => x,
LL | | E::B(x) => x,
LL | | };
| |______________- unnecessary `let` binding
LL |
LL | result
| ^^^^^^
|
help: return the expression directly
|
LL ~
LL |
LL ~ (match self {
LL + E::A(x) => x,
LL + E::B(x) => x,
LL + }) as _
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:223:9
|
LL | let s = if true { "a".to_string() } else { "b".to_string() } + "c";
| ------------------------------------------------------------------- unnecessary `let` binding
LL | s
| ^
|
help: return the expression directly
|
LL ~
LL ~ (if true { "a".to_string() } else { "b".to_string() } + "c")
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:229:9
|
LL | let s = "c".to_string() + if true { "a" } else { "b" };
| ------------------------------------------------------- unnecessary `let` binding
LL | s
| ^
|
help: return the expression directly
|
LL ~
LL ~ "c".to_string() + if true { "a" } else { "b" }
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:235:9
|
LL | let s = { "a".to_string() } + "b" + { "c" } + "d";
| -------------------------------------------------- unnecessary `let` binding
LL | s
| ^
|
help: return the expression directly
|
LL ~
LL ~ ({ "a".to_string() } + "b" + { "c" } + "d")
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:243:13
|
LL | let s = if true { 2 } else { 3 } << 4;
| -------------------------------------- unnecessary `let` binding
LL | s
| ^
|
help: return the expression directly
|
LL ~
LL ~ (if true { 2 } else { 3 } << 4)
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:248:13
|
LL | let s = { true } || { false } && { 2 <= 3 };
| -------------------------------------------- unnecessary `let` binding
LL | s
| ^
|
help: return the expression directly
|
LL ~
LL ~ ({ true } || { false } && { 2 <= 3 })
|
error: returning the result of a `let` binding from a block
--> tests/ui/let_and_return.rs:260:5
|
LL | / let r = match &*v.borrow() {
LL | | Some(v) => Ok(Ok(v[0])),
LL | | None => Ok(Ok(0)),
LL | | }?;
| |_______- unnecessary `let` binding
LL | r
| ^
|
help: return the expression directly
|
LL ~
LL ~ match &*v.borrow() {
LL + Some(v) => Ok(Ok(v[0])),
LL + None => Ok(Ok(0)),
LL + }?
|
error: aborting due to 15 previous errors