File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ import (
1111)
1212
1313func ExampleDrop () {
14+ counter := iter .Drop [int ](iter .Count (), 2 )
15+ fmt .Println (counter .Next ().Unwrap ())
16+ // Output: 2
17+ }
18+
19+ func ExampleDrop_method () {
1420 counter := iter .Count ().Drop (2 )
1521 fmt .Println (counter .Next ().Unwrap ())
1622 // Output: 2
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ import (
1212)
1313
1414func ExampleCollect () {
15+ fmt .Println (iter.Collect [int ](iter .Count ().Take (3 )))
16+ // Output: [0 1 2]
17+ }
18+
19+ func ExampleCollect_method () {
1520 fmt .Println (iter .Count ().Take (3 ).Collect ())
1621 // Output: [0 1 2]
1722}
Original file line number Diff line number Diff line change @@ -10,6 +10,17 @@ import (
1010)
1111
1212func ExampleTake () {
13+ iter := iter .Take [int ](iter .Count (), 2 )
14+ fmt .Println (iter .Next ())
15+ fmt .Println (iter .Next ())
16+ fmt .Println (iter .Next ())
17+ // Output:
18+ // Some(0)
19+ // Some(1)
20+ // None
21+ }
22+
23+ func ExampleTake_method () {
1324 iter := iter .Count ().Take (2 )
1425 fmt .Println (iter .Next ())
1526 fmt .Println (iter .Next ())
You can’t perform that action at this time.
0 commit comments