Skip to content

Commit

Permalink
Run rustfix
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Sep 5, 2019
1 parent 8be37fd commit 0b3f452
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions tests/ui/patterns.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// run-rustfix
#![allow(unused)]
#![warn(clippy::all)]
#![feature(slice_patterns)]

fn main() {
let v = Some(true);
let s = [0, 1, 2, 3, 4];
match v {
Some(x) => (),
y => (),
}
match v {
Some(x) => (),
y @ None => (), // no error
}
match s {
[x, inside @ .., y] => (), // no error
[..] => (),
}
}
1 change: 1 addition & 0 deletions tests/ui/patterns.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-rustfix
#![allow(unused)]
#![warn(clippy::all)]
#![feature(slice_patterns)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/patterns.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: the `y @ _` pattern can be written as just `y`
--> $DIR/patterns.rs:10:9
--> $DIR/patterns.rs:11:9
|
LL | y @ _ => (),
| ^^^^^ help: try: `y`
Expand Down

0 comments on commit 0b3f452

Please sign in to comment.