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

Method parse

atomic-identity/src/usage.rs:144–152  ·  view source on GitHub ↗

Parse from a string (case-insensitive).

(s: &str)

Source from the content-addressed store, hash-verified

142
143 /// Parse from a string (case-insensitive).
144 pub fn parse(s: &str) -> Self {
145 match s.to_lowercase().as_str() {
146 "personal" | "p" => IdentityUsage::Personal,
147 "work" | "w" => IdentityUsage::Work,
148 "community" | "c" => IdentityUsage::Community,
149 "bot" | "b" => IdentityUsage::Bot,
150 other => IdentityUsage::Custom(other.to_string()),
151 }
152 }
153
154 /// Get all standard usage types (excluding Custom).
155 pub fn standard_types() -> &'static [IdentityUsage] {

Callers

nothing calls this directly

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected