rye icon indicating copy to clipboard operation
rye copied to clipboard

Replace `once_cell` crate

Open onkoe opened this issue 1 year ago • 2 comments

I noticed that the rye crate uses once_cell as a dependency. However, the OnceCell type is stable as of 1.70.

Are there any reasons to keep the once_cell crate, or can it be safely removed? Happy to make an attempt at a PR! :)

onkoe avatar Mar 30 '24 16:03 onkoe

Hi! Rye uses once_cell::sync::Lazy in several places, e.g. https://github.com/astral-sh/rye/blob/54405065a4885529d31ea48728abcf76c143576f/rye/src/bootstrap.rs#L61-L67

While :OnceCell has been added to std, the same is not yet true for once_cell::sync::Lazy (follow https://github.com/rust-lang/rust/issues/109736 for progress on that)

AlexWaygood avatar Mar 30 '24 18:03 AlexWaygood