try-lazy-init
This is a straightforward fork of the lazy-init
, with fallible initialisation added that I couldn't provide with a wrapper.
Installation
Please use cargo-edit to always add the latest version of this library:
cargo add try-lazy-init
Example
use ;
let lazy = new;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
let lazy_transform = new;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
let lazy_transform_2 = new;
assert_eq!;
assert_eq!;
License
As of 2021-09-05 (i.e. the date of the fork), lazy-init
's Cargo.toml states license = "Apache-2.0/MIT"
while only the MIT License's text is present in LICENSE. I've left this situation unchanged.
As such, consider the package MIT-licensed for use and Apache-2.0/MIT dual-licensed when contributing.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Code of Conduct
Changelog
Versioning
try-lazy-init
strictly follows Semantic Versioning 2.0.0 with the following exceptions:
- The minor version will not reset to 0 on major version changes (except for v1).
Consider it the global feature level. - The patch version will not reset to 0 on major or minor version changes (except for v0.1 and v1).
Consider it the global patch level.
This includes the Rust version requirement specified above.
Earlier Rust versions may be compatible, but this can change with minor or patch releases.
Which versions are affected by features and patches can be determined from the respective headings in CHANGELOG.md.