Skip to content

Consider using once_cell instead of lazy_static #124

@lopopolo

Description

@lopopolo

Hi @BurntSushi, I don't currently use the unicode feature but I am looking to do so. bstr would be the only crate in my lockfile that uses lazy_static. There has been a lot of movement in the ecosystem to port over to once_cell. I personally think the API is nicer and the maintenance status is in a better spot.

once_cell has the added benefit of being slated for inclusion into std, which means it has the potential to simply re-export those std types once they are stabilized.

once_cell's MSRV is in the 1.36 range, which is compatible with the 1.60 MSRV bstr now has.

rustc is also suggesting once_cell for statics:

Here's some examples throughout the ecosystem:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions