matklad / once_cell

Rust library for single assignment cells and lazy statics without macros
Apache License 2.0
1.84k stars 110 forks source link

impl Default for Lazy #56

Closed alexheretic closed 5 years ago

alexheretic commented 5 years ago

Replacing lazystatic in my codebases I've found I'm doing `Lazy::new(<>::default)` a fair bit generally for Mutex use.

This pr streamlines that to Lazy::default(), in a similar way to Arc, Mutex wrappers. Although it won't work in static contexts, which sucks.

matklad commented 5 years ago

Makes sense to add, yeah!

bors r+

bors[bot] commented 5 years ago

Build succeeded

matklad commented 5 years ago

published as 1.1.0