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

Function format_remote_state

atomic-cli/tests/fixtures/helpers_c1.rs:292–299  ·  view source on GitHub ↗

Format the remote state for display.

(state: &StateResponse, entries: &[ChangelistEntry])

Source from the content-addressed store, hash-verified

290
291/// Format the remote state for display.
292fn format_remote_state(state: &StateResponse, entries: &[ChangelistEntry]) -> String {
293 if let Some(merkle_str) = state.merkle() {
294 let short_state = &merkle_str[..12.min(merkle_str.len())];
295 format!("{} ({} changes)", short_state, entries.len())
296 } else {
297 "(empty)".to_string()
298 }
299}
300
301/// Format a count with singular/plural suffix.
302///

Callers 1

display_state_comparisonFunction · 0.70

Calls 2

merkleMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected