From dfdd772220f1364b65219e200f011dc5be951c12 Mon Sep 17 00:00:00 2001 From: Alex Ozer Date: Fri, 15 Nov 2024 11:48:56 -0500 Subject: [PATCH] Fix millis padding bug --- src/split_file.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/split_file.rs b/src/split_file.rs index 7dd0b9d..e424601 100644 --- a/src/split_file.rs +++ b/src/split_file.rs @@ -116,9 +116,11 @@ mod duration_format { { let num = match mat { Some(d) => { - let num = u64::from_str(d.as_str()).map_err(E::custom)?; - let padded = format!("{:0<3}", num); - u64::from_str(&padded).unwrap() + let mut num_str = d.as_str().to_string(); + while num_str.len() < 3 { + num_str.push('0'); + } + u64::from_str(&num_str).unwrap() } None => 0, };