3 ms·
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6d98ea7c6922c8c42aaf2d681ac24e5a https://play.rust-lang.org/?version=stable&mode=debug&e
by brabel 5y ago
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6d98ea7c6922c8c42aaf2d681ac24e5a https://play.rust-lang.org/?version=stable&mode=debug&editio...
This loses the whitespace and consequently positions... but should be enough to get you started...
I use a UTF-8 crate to split words which keeps all whitespace, so I can keep positions correctly, in case you want to do that:
https://unicode-rs.github.io/unicode-segmentation/unicode_segmentation/index.html https://unicode-rs.github.io/unicode-segmentation/unicode_se...