Skip to content

Commit 3a44d3d

Browse files
committed
readme: add section about new crate features
1 parent 8465302 commit 3a44d3d

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,36 @@ recommended for general use.
201201
[Documentation `regex-syntax`.](https://docs.rs/regex-syntax)
202202

203203

204+
### Crate features
205+
206+
This crate comes with several features that permit tweaking the trade off
207+
between binary size, compilation time and runtime performance. Users of this
208+
crate can selectively disable Unicode tables, or choose from a variety of
209+
optimizations performed by this crate to disable.
210+
211+
When all of these features are disabled, runtime match performance may be much
212+
worse, but if you're matching on short strings, or if high performance isn't
213+
necessary, then such a configuration is perfectly serviceable. To disable
214+
all such features, use the following `Cargo.toml` dependency configuration:
215+
216+
```toml
217+
[dependencies.regex]
218+
version = "1.3"
219+
default-features = false
220+
# regex currently requires the standard library, you must re-enable it.
221+
features = ["std"]
222+
```
223+
224+
This will reduce the dependency tree of `regex` down to a single crate
225+
(`regex-syntax`).
226+
227+
The full set of features one can disable are
228+
[in the "Crate features" section of the documentation](https://docs.rs/regex/*/#crate-features).
229+
230+
204231
### Minimum Rust version policy
205232

206-
This crate's minimum supported `rustc` version is `1.28.1`.
233+
This crate's minimum supported `rustc` version is `1.28.0`.
207234

208235
The current **tentative** policy is that the minimum Rust version required
209236
to use this crate can be increased in minor version updates. For example, if

0 commit comments

Comments
 (0)