Debian Codegraph @

src/lib.rs

raw symbols SCIP
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
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 //! A library that provides ASCII-only string and character types, equivalent to the `char`, `str`
12 //! and `String` types in the standard library.
13 //!
14 //! Please refer to the readme file to learn about the different feature modes of this crate.
15 //!
16 //! # Minimum supported Rust version
17 //!
18 //! The minimum Rust version for 1.1.\* releases is 1.41.1.
19 //! Later 1.y.0 releases might require newer Rust versions, but the three most
20 //! recent stable releases at the time of publishing will always be supported.
21 //! For example this means that if the current stable Rust version is 1.70 when
22 //! ascii 1.2.0 is released, then ascii 1.2.\* will not require a newer
23 //! Rust version than 1.68.
24 //!
25 //! # History
26 //!
27 //! This package included the Ascii types that were removed from the Rust standard library by the
28 //! 2014-12 [reform of the `std::ascii` module](https://github.com/rust-lang/rfcs/pull/486). The
29 //! API changed significantly since then.
30
31 #![cfg_attr(not(feature = "std"), no_std)]
32 // Clippy lints
33 #![warn(
34 clippy::pedantic,
35 clippy::decimal_literal_representation,
36 clippy::get_unwrap,
37 clippy::indexing_slicing
38 )]
39 // Naming conventions sometimes go against this lint
40 #![allow(clippy::module_name_repetitions)]
41 // We need to get literal non-asciis for tests
42 #![allow(clippy::non_ascii_literal)]
43 // Sometimes it looks better to invert the order, such as when the `else` block is small
44 #![allow(clippy::if_not_else)]
45 // Shadowing is common and doesn't affect understanding
46 // TODO: Consider removing `shadow_unrelated`, as it can show some actual logic errors
47 #![allow(clippy::shadow_unrelated, clippy::shadow_reuse, clippy::shadow_same)]
48 // A `if let` / `else` sometimes looks better than using iterator adaptors
49 #![allow(clippy::option_if_let_else)]
50 // In tests, we're fine with indexing, since a panic is a failure.
51 #![cfg_attr(test, allow(clippy::indexing_slicing))]
52 // for compatibility with methods on char and u8
53 #![allow(clippy::trivially_copy_pass_by_ref)]
54 // In preparation for feature `unsafe_block_in_unsafe_fn` (https://github.com/rust-lang/rust/issues/71668)
55 #![allow(unused_unsafe)]
56
57 #[cfg(feature = "alloc")]
58 #[macro_use]
59 extern crate allocrust-analyzer cargo ascii 1.1.0 alloc/;
60 #[cfg(feature = "std")]
61 extern crate corerust-analyzer cargo ascii 1.1.0 core/;
62
63 #[cfg(feature = "serde")]
64 extern crate serderust-analyzer cargo ascii 1.1.0 serde/;
65
66 #[cfg(all(test, feature = "serde_test"))]
67 extern crate serde_testrust-analyzer cargo ascii 1.1.0 serde_test/;
68
69 mod ascii_charrust-analyzer cargo ascii 1.1.0 ascii_char/;
70 mod ascii_strrust-analyzer cargo ascii 1.1.0 ascii_str/;
71 #[cfg(feature = "alloc")]
72 mod ascii_stringrust-analyzer cargo ascii 1.1.0 ascii_string/;
73 mod free_functionsrust-analyzer cargo ascii 1.1.0 free_functions/;
74 #[cfg(feature = "serde")]
75 mod serializationrust-analyzer cargo ascii 1.1.0 serialization/;
76
77 pub use ascii_charrust-analyzer cargo ascii 1.1.0 ascii_char/::{AsciiCharrust-analyzer cargo ascii 1.1.0 ascii_char/AsciiChar#, ToAsciiCharrust-analyzer cargo ascii 1.1.0 ascii_char/ToAsciiChar#, ToAsciiCharErrorrust-analyzer cargo ascii 1.1.0 ascii_char/ToAsciiCharError#};
78 pub use ascii_strrust-analyzer cargo ascii 1.1.0 ascii_str/::{AsAsciiStrrust-analyzer cargo ascii 1.1.0 ascii_str/AsAsciiStr#, AsAsciiStrErrorrust-analyzer cargo ascii 1.1.0 ascii_str/AsAsciiStrError#, AsMutAsciiStrrust-analyzer cargo ascii 1.1.0 ascii_str/AsMutAsciiStr#, AsciiStrrust-analyzer cargo ascii 1.1.0 ascii_str/AsciiStr#};
79 pub use ascii_strrust-analyzer cargo ascii 1.1.0 ascii_str/::{Charsrust-analyzer cargo ascii 1.1.0 ascii_str/Chars#, CharsMutrust-analyzer cargo ascii 1.1.0 ascii_str/CharsMut#, CharsRefrust-analyzer cargo ascii 1.1.0 ascii_str/CharsRef#};
80 #[cfg(feature = "alloc")]
81 pub use ascii_stringrust-analyzer cargo ascii 1.1.0 ascii_string/::{AsciiStringrust-analyzer cargo ascii 1.1.0 ascii_string/AsciiString#, FromAsciiErrorrust-analyzer cargo ascii 1.1.0 ascii_string/FromAsciiError#, IntoAsciiStringrust-analyzer cargo ascii 1.1.0 ascii_string/IntoAsciiString#};
82 pub use free_functionsrust-analyzer cargo ascii 1.1.0 free_functions/::{caret_decoderust-analyzer cargo ascii 1.1.0 free_functions/caret_decode()., caret_encoderust-analyzer cargo ascii 1.1.0 free_functions/caret_encode().};