Skip to content

Commit 760eb27

Browse files
committed
Prepare 0.4.0 release
1 parent 0930e06 commit 760eb27

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

.proteto/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
%% block body
33
Forward scan over a vector with mutation and item removal.
44

5-
Provides an iterator like interface over a vector which allows mutation and
6-
removal of items. Items are kept in order and every item is moved at most once,
7-
even when items are removed. Dropping the `VecMutScan` mid-iteration keeps
8-
remaining items in the vector.
5+
Provides a `VecMutScan` wrapper for a `Vec` with an iterator like interface
6+
over which also allows mutation and removal of items. Items are kept in order
7+
and every item is moved at most once, even when items are removed. Dropping the
8+
`VecMutScan` mid-iteration keeps remaining items in the vector.
99

1010
This can be seen as an extension of `Vec`'s `retain` and `drain`. It is also
1111
very similar to the unstable `drain_filter` but slightly more flexible. Unlike
1212
`drain_filter` this specifies the drop behavior (to keep all following
1313
elements). It also doesn't require the filtering to be done within a closure,
1414
which gives additional flexibilty at the cost of not being able to implement
1515
the `Iterator` trait.
16+
17+
Also provides a `VecGrowScan` wrapper that extends `VecMutScan` to allow
18+
insertions during the iteration. This may require additional item moves and
19+
temporary storage, but still runs in linear time.
1620
%% endblock

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## vec_mut_scan 0.4.0 (2021-01-17)
4+
5+
* Add `VecGrowScan` for arbitrary insertions and removals during iteration (contributed by Jakub Kądziołka)
6+
37
## vec_mut_scan 0.3.0 (2020-09-08)
48

59
* Allow mutable access to all vector elements during iteration

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vec_mut_scan"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
authors = ["Jannis Harder <me@jix.one>"]
55
edition = "2018"
66
description = "Forward scan over a vector with mutation and item removal"

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
Forward scan over a vector with mutation and item removal.
99

10-
Provides an iterator like interface over a vector which allows mutation and
11-
removal of items. Items are kept in order and every item is moved at most once,
12-
even when items are removed. Dropping the `VecMutScan` mid-iteration keeps
13-
remaining items in the vector.
10+
Provides a `VecMutScan` wrapper for a `Vec` with an iterator like interface
11+
over which also allows mutation and removal of items. Items are kept in order
12+
and every item is moved at most once, even when items are removed. Dropping the
13+
`VecMutScan` mid-iteration keeps remaining items in the vector.
1414

1515
This can be seen as an extension of `Vec`'s `retain` and `drain`. It is also
1616
very similar to the unstable `drain_filter` but slightly more flexible. Unlike
@@ -19,6 +19,10 @@ elements). It also doesn't require the filtering to be done within a closure,
1919
which gives additional flexibilty at the cost of not being able to implement
2020
the `Iterator` trait.
2121

22+
Also provides a `VecGrowScan` wrapper that extends `VecMutScan` to allow
23+
insertions during the iteration. This may require additional item moves and
24+
temporary storage, but still runs in linear time.
25+
2226
## License
2327

2428
This software is available under the Zero-Clause BSD license, see

0 commit comments

Comments
 (0)