Skip to content

Commit

Permalink
Merge #11
Browse files Browse the repository at this point in the history
11: Prepare 0.4.0 release r=jix a=jix



Co-authored-by: Jannis Harder <me@jix.one>
  • Loading branch information
bors[bot] and jix committed Jan 17, 2021
2 parents 0930e06 + 760eb27 commit 80352cc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
12 changes: 8 additions & 4 deletions .proteto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
%% block body
Forward scan over a vector with mutation and item removal.

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

This can be seen as an extension of `Vec`'s `retain` and `drain`. It is also
very similar to the unstable `drain_filter` but slightly more flexible. Unlike
`drain_filter` this specifies the drop behavior (to keep all following
elements). It also doesn't require the filtering to be done within a closure,
which gives additional flexibilty at the cost of not being able to implement
the `Iterator` trait.

Also provides a `VecGrowScan` wrapper that extends `VecMutScan` to allow
insertions during the iteration. This may require additional item moves and
temporary storage, but still runs in linear time.
%% endblock
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## vec_mut_scan 0.4.0 (2021-01-17)

* Add `VecGrowScan` for arbitrary insertions and removals during iteration (contributed by Jakub Kądziołka)

## vec_mut_scan 0.3.0 (2020-09-08)

* Allow mutable access to all vector elements during iteration
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vec_mut_scan"
version = "0.3.0"
version = "0.4.0"
authors = ["Jannis Harder <me@jix.one>"]
edition = "2018"
description = "Forward scan over a vector with mutation and item removal"
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

Forward scan over a vector with mutation and item removal.

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

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

Also provides a `VecGrowScan` wrapper that extends `VecMutScan` to allow
insertions during the iteration. This may require additional item moves and
temporary storage, but still runs in linear time.

## License

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

0 comments on commit 80352cc

Please sign in to comment.