Format the local state for display.
(entries: &[HistoryEntry])
| 496 | |
| 497 | /// Format the local state for display. |
| 498 | fn format_local_state(entries: &[HistoryEntry]) -> String { |
| 499 | if let Some(entry) = entries.last() { |
| 500 | let short_state = &entry.state.to_base32()[..12]; |
| 501 | format!("{} ({} changes)", short_state, entries.len()) |
| 502 | } else { |
| 503 | "(empty)".to_string() |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | /// Format the remote state for display. |
| 508 | fn format_remote_state(state: &StateResponse, entries: &[ChangelistEntry]) -> String { |