(
object: &'a BTreeMap<String, JsonValue>,
key: &str,
context: &str,
)
| 657 | } |
| 658 | |
| 659 | fn expect_string<'a>( |
| 660 | object: &'a BTreeMap<String, JsonValue>, |
| 661 | key: &str, |
| 662 | context: &str, |
| 663 | ) -> Result<&'a str, ConfigError> { |
| 664 | object |
| 665 | .get(key) |
| 666 | .and_then(JsonValue::as_str) |
| 667 | .ok_or_else(|| ConfigError::Parse(format!("{context}: missing string field {key}"))) |
| 668 | } |
| 669 | |
| 670 | fn optional_string<'a>( |
| 671 | object: &'a BTreeMap<String, JsonValue>, |
no test coverage detected