MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / short_key

Function short_key

atomic-cli/src/commands/org/member.rs:244–249  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

242/// characters followed by an ellipsis, so the same key is recognisable in
243/// both places. The full value stays in `--format json`.
244fn 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected