MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / print_sync_row

Function print_sync_row

src/display.rs:339–363  ·  view source on GitHub ↗

Print the third title row: last sync and full sync timestamps, right-aligned in dim.

(
    last_sync_at: u64,
    last_full_sync_at: u64,
    last_sync_duration_ms: u64,
    inner_width: usize,
)

Source from the content-addressed store, hash-verified

337
338/// Print the third title row: last sync and full sync timestamps, right-aligned in dim.
339fn print_sync_row(
340 last_sync_at: u64,
341 last_full_sync_at: u64,
342 last_sync_duration_ms: u64,
343 inner_width: usize,
344) {
345 let duration = format_duration_ms(last_sync_duration_ms);
346 let sync_part = if duration.is_empty() {
347 format!("Last sync {}", format_relative_time(last_sync_at))
348 } else {
349 format!(
350 "Last sync {} ({})",
351 format_relative_time(last_sync_at),
352 duration
353 )
354 };
355 let sync_text = format!(
356 "{} Full sync {}",
357 sync_part,
358 format_relative_time(last_full_sync_at)
359 );
360 let available = inner_width.saturating_sub(2);
361 let pad = available.saturating_sub(sync_text.len());
362 println!("│ {}\x1b[2m{}\x1b[0m │", " ".repeat(pad), sync_text);
363}
364
365fn print_branch_row(info: &BranchInfo, inner_width: usize) {
366 let mut text = format!("Branch: {}", info.branch);

Callers 2

print_status_headerFunction · 0.85
print_status_tableFunction · 0.85

Calls 2

format_duration_msFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected