aboutsummaryrefslogtreecommitdiff
path: root/src/syntax.rs
blob: d075063b0938270b1a29aefa8d7999bce1067f88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Syntax {
    PROTO2,
    PROTO3,
}

impl Syntax {
    pub fn parse(s: &str) -> Self {
        match s {
            "" | "proto2" => Syntax::PROTO2,
            "proto3" => Syntax::PROTO3,
            _ => panic!("unsupported syntax value: {:?}", s),
        }
    }
}