]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/run-pass/match_same_arms_const.rs
New upstream version 1.26.0+dfsg1
[rustc.git] / src / tools / clippy / 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() {}