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

Add Lazy::into_value #131

Closed matklad closed 3 years ago

matklad commented 3 years ago

This API allows to move a T out of Lazy<T>. Note that it requires an owned access to a Lazy -- there's no way to reset a lazy to uninit state via &mut Lazy<T>, as the init function is gone. In other words, fn take(this: &mut Lazy<T>) is an impossible object.

matklad commented 3 years ago

bors r+

matklad commented 3 years ago

bors r-

bors[bot] commented 3 years ago

Canceled.

matklad commented 3 years ago

bors r+

bors[bot] commented 3 years ago

Build failed:

matklad commented 3 years ago

bors r+

bors[bot] commented 3 years ago

Build succeeded: