]>
Commit | Line | Data |
---|---|---|
3c0e092e XL |
1 | // Copyright 2017 The UNIC Project Developers. |
2 | // | |
3 | // See the COPYRIGHT file at the top-level directory of this distribution. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
11 | #![cfg_attr(not(feature = "std"), no_std)] | |
12 | #![cfg_attr(feature = "exact-size-is-empty", feature(exact_size_is_empty))] | |
13 | #![cfg_attr(feature = "trusted-len", feature(trusted_len))] | |
14 | #![warn( | |
15 | bad_style, | |
16 | missing_debug_implementations, | |
17 | missing_docs, | |
18 | unconditional_recursion | |
19 | )] | |
20 | #![deny(unsafe_code)] | |
21 | ||
22 | //! # UNIC — Unicode Character Tools — Character Range | |
23 | //! | |
24 | //! A simple way to control iteration over a range of characters. | |
25 | //! | |
26 | //! # Examples | |
27 | //! | |
28 | //! ``` | |
29 | //! #[macro_use] extern crate unic_char_range; | |
30 | //! | |
31 | //! # fn main() { | |
32 | //! for character in chars!('a'..='z') { | |
33 | //! // character is each character in the lowercase english alphabet in order | |
34 | //! } | |
35 | //! | |
36 | //! for character in chars!(..) { | |
37 | //! // character is every valid char from lowest codepoint to highest | |
38 | //! } | |
39 | //! # } | |
40 | //! ``` | |
41 | //! | |
42 | //! # Features | |
43 | //! | |
44 | //! None of these features are included by default; they rely on unstable Rust feature gates. | |
45 | //! | |
46 | //! - `unstable`: enables all features | |
47 | //! - `exact-size-is-empty`: provide a specific impl of [`ExactSizeIterator::is_empty`][is_empty] | |
48 | //! - `trusted-len`: impl the [`TrustedLen`] contract | |
49 | //! | |
50 | //! [is_empty]: https://doc.rust-lang.org/std/iter/trait.ExactSizeIterator.html#method.is_empty | |
51 | //! [`FusedIterator`]: https://doc.rust-lang.org/std/iter/trait.FusedIterator.html | |
52 | //! [`TrustedLen`]: https://doc.rust-lang.org/std/iter/trait.TrustedLen.html | |
53 | //! | |
54 | ||
55 | mod pkg_info; | |
56 | pub use crate::pkg_info::{PKG_DESCRIPTION, PKG_NAME, PKG_VERSION}; | |
57 | ||
58 | mod iter; | |
59 | pub use crate::iter::CharIter; | |
60 | ||
61 | mod range; | |
62 | pub use crate::range::CharRange; | |
63 | ||
64 | #[macro_use] | |
65 | mod macros; | |
66 | ||
67 | mod step; | |
68 | ||
69 | mod iter_fused; | |
70 | ||
71 | #[cfg(feature = "trusted-len")] | |
72 | mod iter_trusted_len; | |
73 | ||
74 | #[cfg(feature = "rayon")] | |
75 | mod par_iter; |