MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / from_str

Method from_str

crates/rustc_codegen_spirv/src/target_feature.rs:12–22  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

10 type Err = String;
11
12 fn from_str(input: &str) -> Result<Self, Self::Err> {
13 const EXT_PREFIX: &str = "ext:";
14
15 if let Some(input) = input.strip_prefix(EXT_PREFIX) {
16 Ok(Self::Extension(Symbol::intern(input)))
17 } else {
18 Ok(Self::Capability(input.parse().map_err(|_err| {
19 format!("Invalid Capability: `{input}`")
20 })?))
21 }
22 }
23}

Callers

nothing calls this directly

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected