typst / ecow

Compact, clone-on-write vector and string.
Apache License 2.0
205 stars 16 forks source link

Made vec and string generic over ref counter #3

Closed jesnor closed 1 year ago

jesnor commented 1 year ago

Added Counter trait

Don't think you wanna merge as is because I had to make the Vec ptr field into a regular, nullable pointer as I couldn't figure out how to create a static Header<Rc> value for any Rc: Counter.

Also fixed some clippy lints.

laurmaedje commented 1 year ago

As discussed on reddit, I don't believe the added complexity is really worth it here. This of course very opinion-based, but for more extensive discussion on a similar topic, see also here: https://github.com/rust-analyzer/smol_str/pull/37