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