Extract a string from a `regorus::Value` object field.
(val: ®orus::Value, key: &str)
| 644 | |
| 645 | /// Extract a string from a `regorus::Value` object field. |
| 646 | fn get_str(val: ®orus::Value, key: &str) -> Option<String> { |
| 647 | let key_val = regorus::Value::String(key.into()); |
| 648 | match val { |
| 649 | regorus::Value::Object(map) => match map.get(&key_val) { |
| 650 | Some(regorus::Value::String(s)) => Some(s.to_string()), |
| 651 | _ => None, |
| 652 | }, |
| 653 | _ => None, |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | /// Extract a bool from a `regorus::Value` object field. |
| 658 | fn get_bool(val: ®orus::Value, key: &str) -> Option<bool> { |
no test coverage detected