matklad / once_cell

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

Add an into_inner function to Lazy #106

Closed ninegua closed 3 years ago

ninegua commented 4 years ago

This is useful to avoid an extra clone when the purpose is to take out the Lazy value.

matklad commented 3 years ago

Thought a little bit more about this. take-stype API is impossible, but we can use a Result to deconstruct lazy into value/fn "pair": https://github.com/matklad/once_cell/pull/131

matklad commented 3 years ago

closed by https://github.com/matklad/once_cell/pull/131