thomcc / arcstr

Better reference counted strings for Rust
Apache License 2.0
114 stars 18 forks source link

Add a family of builder methods to create an ArcStr using a callback #56

Closed thomcc closed 5 months ago

thomcc commented 5 months ago

Fixes #36

thomcc commented 5 months ago

This adds try_build_unchecked, build_unchecked, and build. In theory I could write a try_build for the case where you don't care that much about performance but do want to handle allocation error, but it seems a bit pointless so I left it out.