summaryrefslogtreecommitdiff
path: root/src/formats/mod.rs
blob: 79b1c5192f288f0fb95debec66855756a8ee4953 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
mod clang;
pub use clang::*;

use crate::*;


#[derive(Clone, Copy, PartialEq)]
pub enum Format {
    Raw,
    Source,
    Clang,
}

impl Format {
    pub fn from_str(string: &str) -> Self {
        match string {
            "raw" => Self::Raw,
            "source" => Self::Source,
            "c" => Self::Clang,
            _ => fatal!("Unknown format '{string}', expected 'raw', 'c', or 'source'"),
        }
    }
}