rustywind_core/
class_wrapping.rs

1/// How individual classes are wrapped.
2#[derive(Debug, Clone, Copy)]
3pub enum ClassWrapping {
4    NoWrapping,
5    CommaSingleQuotes,
6    CommaDoubleQuotes,
7}
8
9impl Default for ClassWrapping {
10    fn default() -> Self {
11        Self::NoWrapping
12    }
13}
14
15impl ClassWrapping {
16    pub fn as_str(&self) -> &'static str {
17        match self {
18            ClassWrapping::NoWrapping => "no-wrapping",
19            ClassWrapping::CommaSingleQuotes => "comma-single-quotes",
20            ClassWrapping::CommaDoubleQuotes => "comma-double-quotes",
21        }
22    }
23}
24
25impl<T: AsRef<str>> From<T> for ClassWrapping {
26    fn from(s: T) -> Self {
27        match s.as_ref() {
28            "no-wrapping" => Self::NoWrapping,
29            "comma-single-quotes" => Self::CommaSingleQuotes,
30            "comma-double-quotes" => Self::CommaDoubleQuotes,
31            _ => Self::NoWrapping,
32        }
33    }
34}