blob: d075063b0938270b1a29aefa8d7999bce1067f88 [file] [log] [blame]
Chih-Hung Hsieh92ff6052020-06-10 20:18:39 -07001#[derive(Debug, Copy, Clone, PartialEq, Eq)]
2pub enum Syntax {
3 PROTO2,
4 PROTO3,
5}
6
7impl Syntax {
8 pub fn parse(s: &str) -> Self {
9 match s {
10 "" | "proto2" => Syntax::PROTO2,
11 "proto3" => Syntax::PROTO3,
12 _ => panic!("unsupported syntax value: {:?}", s),
13 }
14 }
15}