When displaying a string, format the output with arguments.
In this example, each number will have at least a width of two characters. If necessary, a zero will be prepended.
// Where hours, minutes are of type i32
write!(f, "{:02}:{:02}", hours, minutes)
See width arguments.