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

Method from_str

crates/openshell-tui/src/theme.rs:29–38  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

27 type Err = String;
28
29 fn from_str(s: &str) -> Result<Self, Self::Err> {
30 match s.to_lowercase().as_str() {
31 "auto" => Ok(Self::Auto),
32 "dark" => Ok(Self::Dark),
33 "light" => Ok(Self::Light),
34 other => Err(format!(
35 "unknown theme mode: {other} (expected auto, dark, or light)"
36 )),
37 }
38 }
39}
40
41/// Complete color theme for the TUI.

Callers

nothing calls this directly

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected