MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / format_progress_detail

Function format_progress_detail

crates/openshell-driver-docker/src/lib.rs:1682–1696  ·  view source on GitHub ↗
(progress: &ProgressDetail)

Source from the content-addressed store, hash-verified

1680}
1681
1682fn format_progress_detail(progress: &ProgressDetail) -> Option<String> {
1683 let current = progress.current.and_then(|value| u64::try_from(value).ok());
1684 let total = progress
1685 .total
1686 .and_then(|value| u64::try_from(value).ok())
1687 .filter(|value| *value > 0);
1688
1689 match (current, total) {
1690 (Some(current), Some(total)) => {
1691 Some(format!("{}/{}", format_bytes(current), format_bytes(total)))
1692 }
1693 (Some(current), _) if current > 0 => Some(format_bytes(current)),
1694 _ => None,
1695 }
1696}
1697
1698fn attach_docker_progress_metadata(
1699 metadata: &mut HashMap<String, String>,

Callers

nothing calls this directly

Calls 1

format_bytesFunction · 0.85

Tested by

no test coverage detected