Formats time as HH:MM:SS.
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+use fmt::fmt_u32_pad;
+
pub struct Time {
seconds: i32,
minutes: i32,
})
}
}
+
+ pub fn fmt_time(&self, s: &mut [u8]) {
+ let mut offset = 0;
+
+ offset += fmt_u32_pad(&mut s[offset..], self.hours as u32, 2, b'0');
+ s[offset] = b':';
+ offset += 1;
+
+ offset += fmt_u32_pad(&mut s[offset..], self.minutes as u32, 2, b'0');
+ s[offset] = b':';
+ offset += 1;
+
+ fmt_u32_pad(&mut s[offset..], self.seconds as u32, 2, b'0');
+ }
}