]> git.lizzy.rs Git - rust.git/blob - tests/run-pass/match_same_arms_const.rs
Merge pull request #2448 from rust-lang-nursery/fixes
[rust.git] / tests / run-pass / match_same_arms_const.rs
1 #![deny(match_same_arms)]
2
3 const PRICE_OF_SWEETS: u32 = 5;
4 const PRICE_OF_KINDNESS: u32 = 0;
5 const PRICE_OF_DRINKS: u32 = 5;
6
7 pub fn price(thing: &str) -> u32 {
8     match thing {
9         "rolo" => PRICE_OF_SWEETS,
10         "advice" => PRICE_OF_KINDNESS,
11         "juice" => PRICE_OF_DRINKS,
12         _ => panic!()
13     }
14 }
15
16 fn main() {}