hel-time 0.4.1

Simple util crate to deal with time
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub trait Helper: std::fmt::Write {
	#[inline(always)]
	fn write_u8(&mut self, byte: u8) -> std::fmt::Result {
		self.write_str(unsafe { std::str::from_utf8_unchecked(&[byte]) })
	}
}

impl<T: std::fmt::Write> Helper for T {}

// Took inspiration from `chrono` crate
#[macro_export]
macro_rules! write_hundreds {
	($f: ident, $n: expr) => {
		$f.write_u8(b'0' + ($n) as u8 / 10)?;
		$f.write_u8(b'0' + ($n) as u8 % 10)?;
	};
}