2 ms·
I stared at this a few times and I don't get it. The point is you can't implement Pattern, because it's a nightly feature. If you just make your own, that isn'
by tialaramex 5y ago
I stared at this a few times and I don't get it.
The point is you can't implement Pattern, because it's a nightly feature. If you just make your own, that isn't Pattern and provides none of the benefits.
Yes, you can implement your own trait, and provide blanket implementations for it, but unlike Pattern yours is not part of the standard.
The nice thing about Pattern is that if Rust added say split_exactly_six_times() to the standard library that would take separator: Pattern too and so things which implement Pattern qualify, I can't see a way to get that benefit for my own traits.