rust-analyzer / smol_str

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can `Impl From<SmolStr> for Arc<str>` be added?

msdrigg opened this issue · comments

This would allow easy conversion without re-allocating for longer strings. For shorter strings, allocation would be necessary of course.

Looking at the internals, it looks like it could be done with a simple match statement.

I am happy to make the PR if it would have support from the project

And honestly a Impl From<Arc<str>> for SmolStr makes sense as well.

sounds reasonable