File: alternative_exprs.rs

package info (click to toggle)
rust-num-enum 0.7.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 468 kB
  • sloc: makefile: 2
file content (13 lines) | stat: -rw-r--r-- 179 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
const THREE: u8 = 3;

#[derive(num_enum::TryFromPrimitive)]
#[repr(i8)]
enum Numbers {
    Zero = 0,
    #[num_enum(alternatives = [-1, 2, THREE])]
    One = 1,
}

fn main() {

}