Skip to content

Commit 3704131

Browse files
committed
Tidy up feature flag documentation
1 parent 193157c commit 3704131

File tree

6 files changed

+3
-17
lines changed

6 files changed

+3
-17
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ no-dev-version = true
5353
tag-name = "{{version}}"
5454

5555
[package.metadata.docs.rs]
56-
all-features = true
56+
all-features = ["arbitrary", "quickcheck", "serde", "rayon"]
5757
rustdoc-args = ["--cfg", "docsrs"]
5858

5959
[workspace]

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ mod macros;
114114
mod equivalent;
115115
mod mutable_keys;
116116
#[cfg(feature = "serde")]
117+
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
117118
mod serde;
118119
#[cfg(feature = "serde")]
119120
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
@@ -126,6 +127,7 @@ pub mod set;
126127
// Placed after `map` and `set` so new `rayon` methods on the types
127128
// are documented after the "normal" methods.
128129
#[cfg(feature = "rayon")]
130+
#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
129131
mod rayon;
130132

131133
#[cfg(feature = "rustc-rayon")]

src/rayon/map.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//! You will rarely need to interact with this module directly unless you need to name one of the
44
//! iterator types.
55
6-
#![cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
7-
86
use super::collect;
97
use rayon::iter::plumbing::{Consumer, ProducerCallback, UnindexedConsumer};
108
use rayon::prelude::*;

src/rayon/set.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//! You will rarely need to interact with this module directly unless you need to name one of the
44
//! iterator types.
55
6-
#![cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
7-
86
use super::collect;
97
use rayon::iter::plumbing::{Consumer, ProducerCallback, UnindexedConsumer};
108
use rayon::prelude::*;
@@ -22,7 +20,6 @@ use crate::IndexSet;
2220

2321
type Bucket<T> = crate::Bucket<T, ()>;
2422

25-
#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
2623
impl<T, S> IntoParallelIterator for IndexSet<T, S>
2724
where
2825
T: Send,
@@ -37,7 +34,6 @@ where
3734
}
3835
}
3936

40-
#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
4137
impl<T> IntoParallelIterator for Box<Slice<T>>
4238
where
4339
T: Send,
@@ -80,7 +76,6 @@ impl<T: Send> IndexedParallelIterator for IntoParIter<T> {
8076
indexed_parallel_iterator_methods!(Bucket::key);
8177
}
8278

83-
#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
8479
impl<'a, T, S> IntoParallelIterator for &'a IndexSet<T, S>
8580
where
8681
T: Sync,
@@ -95,7 +90,6 @@ where
9590
}
9691
}
9792

98-
#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
9993
impl<'a, T> IntoParallelIterator for &'a Slice<T>
10094
where
10195
T: Sync,
@@ -144,7 +138,6 @@ impl<T: Sync> IndexedParallelIterator for ParIter<'_, T> {
144138
indexed_parallel_iterator_methods!(Bucket::key_ref);
145139
}
146140

147-
#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
148141
impl<'a, T, S> ParallelDrainRange<usize> for &'a mut IndexSet<T, S>
149142
where
150143
T: Send,
@@ -585,7 +578,6 @@ where
585578
}
586579
}
587580

588-
#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
589581
impl<T, S> FromParallelIterator<T> for IndexSet<T, S>
590582
where
591583
T: Eq + Hash + Send,
@@ -605,7 +597,6 @@ where
605597
}
606598
}
607599

608-
#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
609600
impl<T, S> ParallelExtend<T> for IndexSet<T, S>
610601
where
611602
T: Eq + Hash + Send,
@@ -621,7 +612,6 @@ where
621612
}
622613
}
623614

624-
#[cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
625615
impl<'a, T: 'a, S> ParallelExtend<&'a T> for IndexSet<T, S>
626616
where
627617
T: Copy + Eq + Hash + Send + Sync,

src/serde.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg_attr(docsrs, doc(cfg(feature = "serde")))]
2-
31
use serde::de::value::{MapDeserializer, SeqDeserializer};
42
use serde::de::{
53
Deserialize, Deserializer, Error, IntoDeserializer, MapAccess, SeqAccess, Visitor,

src/serde_seq.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
//! }
1919
//! ```
2020
21-
#![cfg_attr(docsrs, doc(cfg(feature = "serde")))]
22-
2321
use serde::de::{Deserialize, Deserializer, SeqAccess, Visitor};
2422
use serde::ser::{Serialize, Serializer};
2523

0 commit comments

Comments
 (0)