(obj: &Map<String, Value>, key: &str)
| 626 | } |
| 627 | |
| 628 | fn string_field(obj: &Map<String, Value>, key: &str) -> Result<String> { |
| 629 | obj.get(key) |
| 630 | .and_then(Value::as_str) |
| 631 | .map(str::to_string) |
| 632 | .ok_or_else(|| CanonicalError::Proof(format!("document is missing '{key}'"))) |
| 633 | } |
| 634 | |
| 635 | fn timestamp_field(obj: &Map<String, Value>, key: &str) -> Result<DateTime<Utc>> { |
| 636 | let raw = string_field(obj, key)?; |
no test coverage detected