MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / parse_bool_like

Function parse_bool_like

crates/openshell-core/src/settings.rs:160–166  ·  view source on GitHub ↗
(raw: &str)

Source from the content-addressed store, hash-verified

158/// Parse common bool-like string values.
159#[must_use]
160pub 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)]
169mod tests {

Callers 7

spawn_set_global_settingFunction · 0.85
apply_global_settingsMethod · 0.85
parse_cli_setting_valueFunction · 0.85
extension_label_enabledFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected