PSeitz / wana_kana_rust

Utility library for checking and converting between Japanese characters - Hiragana, Katakana - and Romaji
MIT License
70 stars 13 forks source link

Support char iterators #3

Open tmfink opened 4 years ago

tmfink commented 4 years ago

There are times when it is desirable to work with a struct that gives constant-time access to chars (such as Vec<char> or VecDeque<char>), but currently the APIs return a String (or take a &str as input).

Currently, users must translate to/from String to work with certain APIs (such as katakana_to_hiragana()). We should try to support iterators over char as input/output.

PSeitz commented 4 years ago

For the input this should be easy, but for the output it's a little bit more effort. But I'm not sure this would reflect best practices, since this is true for every api which accepts &str or String