You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib.rs
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -304,6 +304,17 @@
304
304
//! gsub_limit = "g" | { ? [0-9] ? } ;
305
305
//! ```
306
306
//!
307
+
//! # Features
308
+
//! TPhrase has two features:
309
+
//! - "fastrand": define [`FastrandRng`] and [`DefaultRng`]
310
+
//! - "regex": define [`RegexGsub`] and [`DefaultSubst`]
311
+
//!
312
+
//! They are enalbed by default.
313
+
//!
314
+
//! Disabling the features, the default generic types of [`Generator`] is removed. 1st default generic type needs "fastrand" and "regex", 2nd needs "regex".
315
+
//!
316
+
//! The tests and examples support only the default features.
317
+
//!
307
318
//! # License
308
319
//! TPhrase for Rust is licensed under either of [MIT](http://opensource.org/licenses/MIT) or [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) at your option.
309
320
//!
@@ -330,15 +341,18 @@
330
341
//! Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
331
342
332
343
mod compile_error;
344
+
#[cfg(feature = "fastrand")]
333
345
mod fastrand_rng;
334
346
mod generator;
335
347
mod parser;
336
348
mod random_number_generator;
349
+
#[cfg(feature = "regex")]
337
350
mod regex_substitutor;
338
351
mod substitutor;
339
352
mod utils;
340
353
341
354
pubuse compile_error::CompileError;
355
+
#[cfg(feature = "fastrand")]
342
356
pubuse fastrand_rng::FastrandRng;
343
357
pubuse generator::Generator;
344
358
pubuse generator::SyntaxId;
@@ -347,15 +361,18 @@ pub use parser::data::Syntax;
0 commit comments