Pre-RFC: Pattern API v3.0


#1

Sales pitch:

  • Support pattern API for &str, &mut str, &[T], &mut [T] and &OsStr, optionally Vec<T> and DoublyLinkedList<T>.

  • The new API allows trim_start(&str)'s speed to be improved up to 35×.

Draft:

Prototype:


#2

Relevant: https://crates.io/crates/galil-seiferas


#3

Thanks for the pointer. You mean we could fallback to galil-seiferas instead of naive search when T: PartialEq + !Ord?


#4

Yeah, something like that might be a good idea.

(tho as always, constant factors may be more important for smaller inputs)


#5

Pushed as RFC 2500.