(object: &Value, key: &str)
| 1986 | } |
| 1987 | |
| 1988 | fn string_value(object: &Value, key: &str) -> Option<String> { |
| 1989 | object |
| 1990 | .get(key) |
| 1991 | .and_then(Value::as_str) |
| 1992 | .map(str::trim) |
| 1993 | .filter(|value| !value.is_empty()) |
| 1994 | .map(ToOwned::to_owned) |
| 1995 | } |
| 1996 | |
| 1997 | fn nested_string_value(object: &Value, key_path: &str) -> Option<String> { |
| 1998 | let mut current = object; |
no test coverage detected