pattern_3/
lib.rs

1#![feature(
2    specialization,
3    // used in two places:
4    //  1. to support using the same two-way algorithm for non-Ord slices
5    //  2. to distinguish SpanBehavior between SharedHaystack and (unique) Haystack.
6
7    unboxed_closures,
8    fn_traits,
9    // used to treat `&[char]` as if a `FnMut(char)->bool`.
10
11    arbitrary_self_types,
12    // just for convenience in Wtf8 impl, not required by Needle API
13
14    ptr_offset_from,
15    iterator_find_map,
16    int_to_from_bytes,
17    // some useful library features
18)]
19#![cfg_attr(test, allow(warnings))]
20
21#![cfg_attr(not(feature = "std"), no_std)]
22#[cfg(not(feature = "std"))]
23extern crate core as std;
24
25extern crate memchr;
26
27pub mod haystack;
28pub mod needle;
29mod slices;
30mod strings;
31mod omgwtf8;
32pub mod ext;
33
34pub use haystack::{Hay, Haystack, SharedHaystack, Span};
35pub use needle::{Needle, Searcher, ReverseSearcher, DoubleEndedSearcher, Consumer, ReverseConsumer, DoubleEndedConsumer};
36pub use omgwtf8::Wtf8;