arcstr icon indicating copy to clipboard operation
arcstr copied to clipboard

Implement an `RcStr` (e.g. `Rc<str>`-alike)

Open thomcc opened this issue 3 years ago • 2 comments

That is: a thread-unsafe (e.g. !Send) equivalent to ArcStr. std::rc::Rc would be to RcStr as std::sync::Arc is to ArcStr). It would avoid needing to use atomic operations, but otherwise would support the same features.

This would probably take either a bunch of copy/pasted code, or a big refactor. Neither is exactly ideal, but I've wanted a Rc version of this a few times.

I'm not sure if this would be better as a separate crate. (Ideally not, as it would allow sharing code, but this might take renaming the arcstr::literal! macro, and honestly the arcstr name implies, well, Arc-equivalence, so the name is a bit weird).

thomcc avatar Jan 02 '22 12:01 thomcc

+1 on this!

gzz2000 avatar Mar 26 '22 06:03 gzz2000

Hm, yeah, it would be a nice addition.

thomcc avatar Mar 26 '22 06:03 thomcc