whatisinternet / Inflector

A rust inflection library
https://docs.rs/Inflector
BSD 2-Clause "Simplified" License
126 stars 28 forks source link

Conversions should not consume String #47

Closed RReverser closed 7 years ago

RReverser commented 7 years ago

Looks like most (all?) conversions create a new String, which means it should be sufficient for them to accept &str and not a String.

This way it would be possible to convert borrowed strings without cloning them (which is expensive due to extra temporary heap allocation and copying data).

whatisinternet commented 7 years ago

:+1:. I'd be interested in a PR if you're up for it. If not I'll have a look over the next few days.