wgsl_parse/syntax_impl.rs
use std::str::FromStr;
use super::{error::ParseError, syntax::*};
impl FromStr for DiagnosticSeverity {
type Err = ParseError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"error" => Ok(Self::Error),
"warning" => Ok(Self::Warning),
"info" => Ok(Self::Info),
"off" => Ok(Self::Off),
_ => Err(ParseError::ParseDiagnosticSeverity),
}
}
}