Skip to content

Commit 193157c

Browse files
committed
Improve feature flag documentation
1 parent e66f3b2 commit 193157c

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/lib.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! [`IndexSet`]: set/struct.IndexSet.html
1515
//!
1616
//!
17-
//! ### Feature Highlights
17+
//! ### Highlights
1818
//!
1919
//! [`IndexMap`] and [`IndexSet`] are drop-in compatible with the std `HashMap`
2020
//! and `HashSet`, but they also have some features of note:
@@ -26,6 +26,28 @@
2626
//! - The [`MutableKeys`][map::MutableKeys] trait, which gives opt-in mutable
2727
//! access to hash map keys.
2828
//!
29+
//! ### Feature Flags
30+
//!
31+
//! To reduce the amount of compiled code in the crate by default, certain
32+
//! features are gated behind [feature flags]. These allow you to opt in to (or
33+
//! out of) functionality. Below is a list of the features available in this
34+
//! crate.
35+
//!
36+
//! * `std`: Enables features which require the Rust standard library. For more
37+
//! information see the section on [`no_std`].
38+
//! * `rayon`: Enables parallel iteration and other parallel methods.
39+
//! * `serde`: Adds implementations for [`Serialize`] and [`Deserialize`]
40+
//! to [`IndexMap`] and [`IndexSet`]. Alternative implementations for
41+
//! (de)serializing [`IndexMap`] as an ordered sequence are available in the
42+
//! [`serde_seq`] module.
43+
//!
44+
//! _Note: only the `std` feature is enabled by default._
45+
//!
46+
//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section
47+
//! [`no_std`]: #no-standard-library-targets
48+
//! [`Serialize`]: `::serde::Serialize`
49+
//! [`Deserialize`]: `::serde::Deserialize`
50+
//!
2951
//! ### Alternate Hashers
3052
//!
3153
//! [`IndexMap`] and [`IndexSet`] have a default hasher type `S = RandomState`,

0 commit comments

Comments
 (0)