the ultimate &[u8]::contains thread

76 points EmberElement 40 comments

Routinely bump into this, much research reveals no solution that results in ideal finger memory. What are ideal solutions to ::contains() and/or ::find() on &[u8]? I think it's hopeless to suggest iterator tricks, that's not much better than cutpaste in terms of memorability in practice