(literal: &str)
| 40 | } |
| 41 | |
| 42 | pub 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…