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

Function parse_bool_value

cranelift/codegen/src/settings.rs:223–229  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

221}
222
223fn parse_bool_value(value: &str) -> SetResult<bool> {
224 match value {
225 "true" | "on" | "yes" | "1" => Ok(true),
226 "false" | "off" | "no" | "0" => Ok(false),
227 _ => Err(SetError::BadValue("bool".to_string())),
228 }
229}
230
231fn parse_enum_value(value: &str, choices: &[&str]) -> SetResult<u8> {
232 match choices.iter().position(|&tag| tag == value) {

Callers 1

setMethod · 0.85

Calls 2

OkFunction · 0.85
to_stringMethod · 0.45

Tested by

no test coverage detected