strs_tools/
lib.rs

1#![ cfg_attr( all( feature = "no_std", not( feature = "std" ) ), no_std ) ]
2#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ]
3#![ doc
4(
5  html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico"
6) ]
7#![ doc( html_root_url = "https://docs.rs/strs_tools/latest/strs_tools/" ) ]
8#![ cfg_attr( doc, doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "readme.md" ) ) ) ]
9#![ cfg_attr( not( doc ), doc = "String manipulation utilities" ) ]
10#![ allow( clippy::std_instead_of_alloc ) ]
11#![ allow( clippy::must_use_candidate ) ]
12#![ allow( clippy::elidable_lifetime_names ) ]
13#![ allow( clippy::std_instead_of_core ) ]
14#![ allow( clippy::manual_strip ) ]
15#![ allow( clippy::doc_markdown ) ]
16#![ allow( clippy::new_without_default ) ]
17#![ allow( clippy::clone_on_copy ) ]
18#![ allow( clippy::single_match_else ) ]
19#![ allow( clippy::return_self_not_must_use ) ]
20#![ allow( clippy::match_same_arms ) ]
21#![ allow( clippy::missing_panics_doc ) ]
22#![ allow( clippy::missing_errors_doc ) ]
23#![ allow( clippy::iter_cloned_collect ) ]
24#![ allow( clippy::redundant_closure ) ]
25#![ allow( clippy::uninlined_format_args ) ]
26
27//! # Rule Compliance & Architectural Notes
28//!
29//! This crate has been systematically updated to comply with the Design and Codestyle Rulebooks.
30//! Key compliance achievements and ongoing considerations :
31//!
32//! ## Completed Compliance Work :
33//!
34//! 1. **Documentation Strategy** : Uses `#![ doc = include_str!(...) ]` to include readme.md
35//!    instead of duplicating documentation. This is the mandated approach for all entry files.
36//!
37//! 2. **Workspace Dependencies** : All external dependencies now inherit from workspace with
38//!    `{ workspace = true }`. SIMD optimization deps (memchr, aho-corasick, bytecount, lexical)
39//!    were moved to workspace level for version consistency.
40//!
41//! 3. **Attribute Formatting** : All attributes use proper spacing per Universal Formatting Rule :
42//!    `#[ cfg( feature = "enabled" ) ]` instead of `#[ cfg( feature = "enabled" ) ]`
43//!
44//! 4. **Manual Namespace Architecture** : Uses the standard wTools manual namespace pattern
45//!    (private/own/orphan/exposed/prelude) for precise API control and stable public interfaces.
46//!
47//! ## Critical Architectural Decisions :
48//!
49//! - **Feature Gating** : All functionality is gated behind the "enabled" feature for
50//!   granular control over compilation and dependencies.
51//!
52//! - **Error Handling** : Uses `error_tools` exclusively - no `anyhow` or `thiserror` dependencies
53//!   per Design Rulebook requirements.
54//!
55//! - **Testing Isolation** : All tests are in `tests/` directory, never in `src/`, following
56//!   the mandatory testing architecture pattern.
57
58/// String tools.
59#[ cfg( feature = "enabled" ) ]
60pub mod string;
61
62/// SIMD-optimized string operations.
63#[ cfg( all( feature = "enabled", feature = "simd" ) ) ]
64pub mod simd;
65
66/// Re-export compile-time optimization macros.
67#[ cfg( all( feature = "enabled", feature = "compile_time_optimizations" ) ) ]
68#[ allow( unused_imports ) ]
69pub use strs_tools_meta::*;
70
71#[ doc( inline ) ]
72#[ allow( unused_imports ) ]
73#[ cfg( feature = "enabled" ) ]
74pub use own::*;
75
76/// Own namespace of the module.
77#[ cfg( feature = "enabled" ) ]
78#[ allow( unused_imports ) ]
79pub mod own
80{
81  #[ allow( unused_imports ) ]
82  use super::*;
83  pub use orphan::*;
84  pub use super::string;
85  #[ cfg( feature = "simd" ) ]
86  pub use super::simd;
87  #[ cfg( test ) ]
88  pub use super::string::orphan::*;
89}
90
91/// Parented namespace of the module.
92#[ cfg( feature = "enabled" ) ]
93#[ allow( unused_imports ) ]
94pub mod orphan
95{
96  #[ allow( unused_imports ) ]
97  use super::*;
98  pub use exposed::*;
99}
100
101/// Exposed namespace of the module.
102#[ cfg( feature = "enabled" ) ]
103#[ allow( unused_imports ) ]
104pub mod exposed
105{
106  #[ allow( unused_imports ) ]
107  use super::*;
108  pub use prelude::*;
109  pub use super::string::exposed::*;
110}
111
112/// Namespace of the module to include with `use module::*`.
113#[ cfg( feature = "enabled" ) ]
114#[ allow( unused_imports ) ]
115pub mod prelude
116{
117  #[ allow( unused_imports ) ]
118  use super::*;
119  pub use super::string::prelude::*;
120}