pub fn format_shard_pattern(pattern: &str, value: usize) -> Result<String>Expand description
Format value into a printf-style integer pattern such as %06d.
Shard writers take their output patterns in this form for compatibility
with the Python API, where the pattern is used with the % operator.
use webdataset_core::utils::format_shard_pattern;
assert_eq!(format_shard_pattern("out-%06d.tar", 12).unwrap(), "out-000012.tar");
assert_eq!(format_shard_pattern("out-%d.tar", 12).unwrap(), "out-12.tar");