Accept either the base32 id or the full URN.
(raw: &str)
| 605 | |
| 606 | /// Accept either the base32 id or the full URN. |
| 607 | fn normalize_id(raw: &str) -> CliResult<String> { |
| 608 | DelegationId::from_base32(raw) |
| 609 | .map(|id| id.to_base32()) |
| 610 | .ok_or_else(|| CliError::InvalidArgument { |
| 611 | message: format!("'{raw}' is not a delegation id"), |
| 612 | }) |
| 613 | } |
| 614 | |
| 615 | fn load_document(store: &IdentityStore, raw: &str) -> CliResult<String> { |
| 616 | let id = normalize_id(raw)?; |