]> git.lizzy.rs Git - rust.git/blob - tests/ui/crashes/match_same_arms_const.rs
Rollup merge of #4820 - guanqun:comment-fix, r=flip1995
[rust.git] / tests / ui / crashes / match_same_arms_const.rs
1 // run-pass
2
3 #![deny(clippy::match_same_arms)]
4
5 /// Test for https://github.com/rust-lang/rust-clippy/issues/2427
6
7 const PRICE_OF_SWEETS: u32 = 5;
8 const PRICE_OF_KINDNESS: u32 = 0;
9 const PRICE_OF_DRINKS: u32 = 5;
10
11 pub fn price(thing: &str) -> u32 {
12     match thing {
13         "rolo" => PRICE_OF_SWEETS,
14         "advice" => PRICE_OF_KINDNESS,
15         "juice" => PRICE_OF_DRINKS,
16         _ => panic!(),
17     }
18 }
19
20 fn main() {}