MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / string_literal_to_boolean

Function string_literal_to_boolean

crates/gitql-core/src/values/converters.rs:42–59  ·  view source on GitHub ↗
(literal: &str)

Source from the content-addressed store, hash-verified

40}
41
42pub fn string_literal_to_boolean(literal: &str) -> Box<dyn Value> {
43 match literal {
44 // True values literal
45 "t" => Box::new(BoolValue::new_true()),
46 "true" => Box::new(BoolValue::new_true()),
47 "y" => Box::new(BoolValue::new_true()),
48 "yes" => Box::new(BoolValue::new_true()),
49 "1" => Box::new(BoolValue::new_true()),
50 // False values literal
51 "f" => Box::new(BoolValue::new_false()),
52 "false" => Box::new(BoolValue::new_false()),
53 "n" => Box::new(BoolValue::new_false()),
54 "no" => Box::new(BoolValue::new_false()),
55 "0" => Box::new(BoolValue::new_false()),
56 // Invalid value, must be unreachable
57 _ => Box::new(NullValue),
58 }
59}

Callers 1

cast_opMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…