Skip to content

Commit 15fca10

Browse files
committed
Fix: deprecate module crate::gens::sized
It just does not have a good enough use case to be kept in API - simplifying.
1 parent ceba0a6 commit 15fca10

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

DOCUMENTATION.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ let mostly_true = gens::bool::with_ratio(1,20);
177177

178178
There are also specialized generators:
179179

180-
* In `gens::sized`, generators that produce progressively larger values, useful
181-
for controlling the size of generated collections.
182180
* In `gens::fixed`, generators that produce fixed values without randomness.
183181

184182
```rust

src/gens/sized.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ use rand::SeedableRng;
1515
/// For now, the max size example value generated starts at really low size, its
1616
/// max size increases with roughly 30% for each example and is limited to max
1717
/// size 100_000.
18+
#[deprecated = "To be removed without replacement due to high complexity and lack of obvious use case"]
19+
#[allow(deprecated)]
1820
pub fn default() -> BoxGen<usize> {
1921
progressively_increasing(0, 30, 100_000)
2022
}
@@ -35,6 +37,7 @@ pub fn default() -> BoxGen<usize> {
3537
/// All in all, this should hopefully ensure a good test coverage, first testing
3638
/// with small sizes and later on with possibly larger ones too, hitting a good
3739
/// balance between test coverage and performance.
40+
#[deprecated = "To be removed without replacement due to high complexity and lack of obvious use case"]
3841
pub fn progressively_increasing(
3942
start_size: usize,
4043
percent_increase: usize,
@@ -119,6 +122,7 @@ mod test {
119122
}
120123

121124
#[test]
125+
#[allow(deprecated)]
122126
pub fn generator_should_never_exceed_max_size() {
123127
let max_size = 7;
124128
let extra_large = 7_000;
@@ -133,6 +137,7 @@ mod test {
133137
}
134138

135139
#[test]
140+
#[allow(deprecated)]
136141
pub fn generator_should_behave_reasonably() {
137142
// If max increments linearly with one each example taken, from start
138143
// value 0, the aggregated sum of all generated values should end up

0 commit comments

Comments
 (0)