memchr 0.1.3

Safe interface to memchr.

This crate provides a single function, memchr, which exposes a safe interface to the corresponding function in libc.

Build status

Dual-licensed under MIT or the UNLICENSE.



On my system (Linux/amd64), memchr is about an order of magnitude faster than the more idiomatic haystack.iter().position(|&b| b == needle):

test iterator    ... bench:       5,301 ns/iter (+/- 2,745)
test libc_memchr ... bench:         203 ns/iter (+/- 17)