sometimes wish rust had reference-counted copy-on-write strings like qt

"you could implement that yourself" yeah i guess but the friction's a bit high

Rc in std::rc - Rust

A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.

@whitequark That's an option…

I guess part of the problem is that in Qt, all the *consumers* of my strings can accept QString, whereas I am uncertain the various things I feed strings to will be able to accept it without cloning. We got used to String and copy.

@mcc everything that accepts &str should be able to consume a &Rc<String> I think... you might need to throw in an .as_ref()
@whitequark @mcc That's a double indirection though, could be better.