MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / from_str

Method from_str

atomic-cli/src/output/colors.rs:79–89  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

77 type Err = String;
78
79 fn from_str(s: &str) -> Result<Self, Self::Err> {
80 match s.to_lowercase().as_str() {
81 "auto" => Ok(Self::Auto),
82 "always" | "yes" | "true" | "1" => Ok(Self::Always),
83 "never" | "no" | "false" | "0" => Ok(Self::Never),
84 other => Err(format!(
85 "Invalid color mode: '{}'. Use auto, always, or never.",
86 other
87 )),
88 }
89 }
90}
91
92// Status Characters

Callers

nothing calls this directly

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected