unicode-categories
unicode-categories copied to clipboard
Duplicate condition on both sides of ||
In https://github.com/swgillespie/unicode-categories/blob/master/src/lib.rs#L182-L183:
|| self.is_punctuation_close()
|| self.is_punctuation_close()
The second one is redundant and should be removed.
The compiler will optimize this away from binary code, but the overall implementation is still slow. You might be interested in finl_unicode, which I just released on crates.io. It supports the latest Unicode standard and is 10–20 times faster than unicode-categories.