(raw: &str)
| 158 | /// Parse common bool-like string values. |
| 159 | #[must_use] |
| 160 | pub fn parse_bool_like(raw: &str) -> Option<bool> { |
| 161 | match raw.trim().to_ascii_lowercase().as_str() { |
| 162 | "1" | "true" | "yes" | "y" | "on" => Some(true), |
| 163 | "0" | "false" | "no" | "n" | "off" => Some(false), |
| 164 | _ => None, |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | #[cfg(test)] |
| 169 | mod tests { |
no test coverage detected