Skip to content

Commit a6ab6f4

Browse files
committed
Delete unused variable y in test
This fixes the errors occuring while running the ui tests
1 parent 815a920 commit a6ab6f4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

tests/ui/option_take_on_temporary.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
fn main() {
44
println!("Testing option_take_on_temporary");
55
let x = Some(3);
6-
let y = x.as_ref();
6+
x.as_ref();
77
}

tests/ui/option_take_on_temporary.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
fn main() {
44
println!("Testing option_take_on_temporary");
55
let x = Some(3);
6-
let y = x.as_ref().take();
6+
x.as_ref().take();
77
}

tests/ui/option_take_on_temporary.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Called `Option::take()` on a temporary value
2-
--> $DIR/option_take_on_temporary.rs:6:13
2+
--> $DIR/option_take_on_temporary.rs:6:5
33
|
4-
LL | let y = x.as_ref().take();
5-
| ^^^^^^^^^^^^^^^^^ help: try: `x.as_ref()`
4+
LL | x.as_ref().take();
5+
| ^^^^^^^^^^^^^^^^^ help: try: `x.as_ref()`
66
|
77
= note: `-D clippy::option-take-on-temporary` implied by `-D warnings`
88

0 commit comments

Comments
 (0)