Skip to content

Commit 5ded6cd

Browse files
committed
wildcard_match_arm: format test.
1 parent ab5fe9a commit 5ded6cd

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

tests/ui/wildcard_match_arm.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22

33
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
44
enum Color {
5-
Red,
6-
Green,
7-
Blue,
8-
Rgb(u8, u8, u8),
9-
Cyan,
5+
Red,
6+
Green,
7+
Blue,
8+
Rgb(u8, u8, u8),
9+
Cyan,
1010
}
1111

1212
impl Color {
13-
fn is_monochrome(self) -> bool {
14-
match self {
15-
Color::Red | Color::Green | Color::Blue => true,
16-
Color::Rgb(r, g, b) => r | g == 0 || r | b == 0 || g | b == 0,
17-
Color::Cyan => false,
18-
}
19-
}
13+
fn is_monochrome(self) -> bool {
14+
match self {
15+
Color::Red | Color::Green | Color::Blue => true,
16+
Color::Rgb(r, g, b) => r | g == 0 || r | b == 0 || g | b == 0,
17+
Color::Cyan => false,
18+
}
19+
}
2020
}
2121

2222
fn main() {
23-
let color = Color::Rgb(0, 0, 127);
24-
match color {
25-
Color::Red => println!("Red"),
26-
_ => eprintln!("Not red"),
27-
};
28-
match color {
29-
Color::Red => {},
30-
Color::Green => {},
31-
Color::Blue => {},
32-
Color::Cyan => {},
33-
c if c.is_monochrome() => {},
34-
Color::Rgb(_, _, _) => {},
35-
};
36-
}
23+
let color = Color::Rgb(0, 0, 127);
24+
match color {
25+
Color::Red => println!("Red"),
26+
_ => eprintln!("Not red"),
27+
};
28+
match color {
29+
Color::Red => {},
30+
Color::Green => {},
31+
Color::Blue => {},
32+
Color::Cyan => {},
33+
c if c.is_monochrome() => {},
34+
Color::Rgb(_, _, _) => {},
35+
};
36+
}

0 commit comments

Comments
 (0)