Format a manifest's state for display.
(manifest: &ViewManifest)
| 464 | |
| 465 | /// Format a manifest's state for display. |
| 466 | fn format_manifest_state(manifest: &ViewManifest) -> String { |
| 467 | if manifest.changes.is_empty() { |
| 468 | "(empty)".to_string() |
| 469 | } else { |
| 470 | let state = manifest.state.to_base32(); |
| 471 | format!( |
| 472 | "{} ({} changes)", |
| 473 | &state[..12.min(state.len())], |
| 474 | manifest.changes.len() |
| 475 | ) |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | /// Format a count with singular/plural suffix. |
| 480 | /// |