Abbreviate a base32 public key for table display. Matches `identity list --verbose`, which prints the first 16 base32 characters followed by an ellipsis, so the same key is recognisable in both places. The full value stays in `--format json`.
(key: &str)
| 242 | /// characters followed by an ellipsis, so the same key is recognisable in |
| 243 | /// both places. The full value stays in `--format json`. |
| 244 | fn short_key(key: &str) -> String { |
| 245 | match key.char_indices().nth(16) { |
| 246 | Some((cut, _)) => format!("{}...", &key[..cut]), |
| 247 | None => key.to_string(), |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | // --------------------------------------------------------------------------- |
| 252 | // Add |
nothing calls this directly
no outgoing calls
no test coverage detected