Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Oldest valid date initialised only once!
**NOTE**: This uses `LazyLock` which was stabilised recently in Rust 1.80. This means we're effectively pushing the MSRV (minimum supported Rust version) to 1.80+ which is relatively fresh ([July 2024]). I'm not too keen on [the alternatives]: 1. No nothing: Create a new datetime every time the `validate_date()` is called - possibly slow/unnecesary, although maybe not a tragedy 2. Use a dependency just for this (either `lazy_static` or `once_cell`) - just seems wrong to use a crate when this is now in the standard library I think `LazyLock` is just too good to pass on and we should keep it simple and just use it. From local testing we require 1.74+ anyway so we're "just" pushing the MSRV 6 Rust releases ahead. And update Rust with `rustup update` is trivial. [July 2024]: https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html [the alternatives]: rust-lang-nursery/lazy-static.rs#214
- Loading branch information