3 ms·
Aha, I didn't notice the little [+] widget next to the Iterator trait in the docs. You have to click it to get the Item type, otherwise it's hidden. Thanks!
by jeffbee 6y ago
Aha, I didn't notice the little [+] widget next to the Iterator trait in the docs. You have to click it to get the Item type, otherwise it's hidden. Thanks!
- Measter 6y agoYou're welcome. The implementation in the OP uses a more functional style, but that's not the only way Rust is commonly written. I also did an implementation[0] (because I have nothing better to do) using more of an imperative style, which you may be more familiar with. Admittedly I did go a bit overkill on string normalization and avoiding allocations while doing so. It also includes a test case which the OP's implementation will get wrong because the order of the combining diacritics is different in both words. If you don't normalize them you'll get two different words. [0] https://gist.github.com/Measter/e2e287ee21311d34ea8eb8cd9d5783be https://gist.github.com/Measter/e2e287ee21311d34ea8eb8cd9d57...