Projects🔗
Time🔗
In late 2019, I requested to take over the unmaintained time crate for Rust. As anyone that has ever worked with time can attest to, this is no small feat. By December, I had released the first major release in over six years. As a foundational crate in the Rust ecosystem, time is used by a sizable portion of the Rust ecosystem.
The revamped time crate includes extensive documentation and nearly 100% test coverage. The only
unsafe
usage is where the compiler requires it to interact with the operating system; all usages
have safety documented. Macros are provided to allow for compile-time verification of certain data,
avoiding unnecessary runtime costs.
Standback🔗
During (re)development of the time crate, I frequently found myself writing shims to allow the use
of recently-stabilized APIs on older compilers. However, it was necessary to use
.rem_euclid_shim()
instead of .rem_euclid()
to avoid name collisions on newer compilers.
As it may be, it's not too difficult to bring code from Rust's standard library to a third-party
crate, allowing the use on older compilers. By gating and aliasing to std
(or core
) as
appropriate, it was possible to avoid this. This turns out to be incredibly useful as a standalone
crate; it allows others to use newer APIs with near-zero effort: just a single line of code per file
for most use cases.