#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Feature {
Comments,
Nesting,
Arrays,
TypedScalars,
Sections,
}
impl Feature {
pub fn as_str(self) -> &'static str {
match self {
Feature::Comments => "comments",
Feature::Nesting => "nesting",
Feature::Arrays => "arrays",
Feature::TypedScalars => "typed scalars",
Feature::Sections => "sections",
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn names() {
assert_eq!(Feature::Comments.as_str(), "comments");
assert_eq!(Feature::Nesting.as_str(), "nesting");
assert_eq!(Feature::Arrays.as_str(), "arrays");
assert_eq!(Feature::TypedScalars.as_str(), "typed scalars");
assert_eq!(Feature::Sections.as_str(), "sections");
}
}