@@ -10,6 +10,9 @@ then **please first file an issue** describing your proposal._
10
10
To pass CI tests successfully, your code must be free of "compiler warnings" and "clippy warnings" and be "rustfmt" formatted.
11
11
12
12
## Write a new method/adaptor for ` Itertools ` trait
13
+ In general, the code logic should be tested with [ quickcheck] ( https://crates.io/crates/quickcheck ) tests in ` tests/quick.rs `
14
+ which allow us to test properties about the code with randomly generated inputs.
15
+
13
16
### Behind ` use_std ` /` use_alloc ` feature?
14
17
If it needs the "std" (such as using hashes) then it should be behind the ` use_std ` feature,
15
18
or if it requires heap allocation (such as using vectors) then it should be behind the ` use_alloc ` feature.
@@ -32,6 +35,8 @@ Iterators are [lazy](https://doc.rust-lang.org/std/iter/index.html#laziness):
32
35
- structs of iterator adaptors should have ` #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] ` ;
33
36
- structs of iterators should have ` #[must_use = "iterators are lazy and do nothing unless consumed"] ` .
34
37
38
+ Those behaviors are ** tested** in ` tests/laziness.rs ` .
39
+
35
40
## Specialize ` Iterator ` methods
36
41
It might be more performant to specialize some methods.
37
42
However, each specialization should be thoroughly tested.
@@ -63,6 +68,9 @@ Additionally,
63
68
64
69
An adaptor might use the inner iterator specializations for its own specializations.
65
70
71
+ They are ** tested** in ` tests/specializations.rs ` and ** benchmarked** in ` benches/specializations.rs `
72
+ (build those benchmarks is slow so you might want to temporarily remove the ones you do not want to measure).
73
+
66
74
## Additional implementations
67
75
### The [ ` Debug ` ] ( https://doc.rust-lang.org/std/fmt/trait.Debug.html ) implementation
68
76
All our iterators should implement ` Debug ` .
@@ -159,6 +167,8 @@ The conditions on which it should be implemented are usually the ones from the `
159
167
### When to implement [ ` itertools::PeekingNext ` ] ( https://docs.rs/itertools/latest/itertools/trait.PeekingNext.html )
160
168
TODO
161
169
170
+ This is currently ** tested** in ` tests/test_std.rs ` .
171
+
162
172
## About lending iterators
163
173
TODO
164
174
0 commit comments