MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / parse

Method parse

crates/cli-flags/src/opt.rs:338–343  ·  view source on GitHub ↗
(val: Option<&str>)

Source from the content-addressed store, hash-verified

336impl WasmtimeOptionValue for String {
337 const VAL_HELP: &'static str = "=val";
338 fn parse(val: Option<&str>) -> Result<Self> {
339 match val {
340 Some(val) => Ok(val.to_string()),
341 None => bail!("value must be specified with `key=val` syntax"),
342 }
343 }
344
345 fn display(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
346 f.write_str(self)

Callers 1

setMethod · 0.45

Calls 9

OkFunction · 0.85
parseFunction · 0.50
newFunction · 0.50
to_stringMethod · 0.45
replaceMethod · 0.45
orMethod · 0.45
as_strMethod · 0.45
unwrapMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected