(obj: &Map<String, Value>, key: &str)
| 591 | } |
| 592 | |
| 593 | fn string_field(obj: &Map<String, Value>, key: &str) -> Result<String> { |
| 594 | obj.get(key) |
| 595 | .and_then(Value::as_str) |
| 596 | .map(str::to_string) |
| 597 | .ok_or_else(|| CanonicalError::Proof(format!("document is missing '{key}'"))) |
| 598 | } |
| 599 | |
| 600 | fn timestamp_field(obj: &Map<String, Value>, key: &str) -> Result<DateTime<Utc>> { |
| 601 | let raw = string_field(obj, key)?; |
no test coverage detected