shared_bytes/
lib.rs

1mod errors;
2mod owned_slice;
3mod range_of_subset;
4mod shared_bytes;
5mod shared_str;
6mod util;
7
8pub use self::{
9    errors::IndexOutOfBounds,
10    range_of_subset::RangeOfSubset,
11    shared_bytes::{IntoIter, Iter, SharedBytes},
12    shared_str::SharedStr,
13};
14
15const UNSAFE_OPTIMISATIONS_DEFAULT: bool = true;
16
17#[allow(clippy::if_same_then_else)] // seems to be a false positive by clippy
18const UNSAFE_OPTIMISATIONS: bool = if cfg!(test) {
19    // if --all-features { true } else { false }
20    cfg!(feature = "unstable_feature_unsafe_optimizations")
21} else if cfg!(feature = "unstable_feature_no_unsafe_optimizations") {
22    false
23} else if cfg!(feature = "unstable_feature_unsafe_optimizations") {
24    true
25} else {
26    UNSAFE_OPTIMISATIONS_DEFAULT
27};