Take Until
This crate adds the take_until method as an extension for iterators.
Examples
Parsing the next base 128 varint from a byte slice.
use TakeUntilExt;
let varint = &;
let int: u32 = varint
.iter
.take_until
.enumerate
.fold;
assert_eq!;
Take Until vs Take While (from Standard Library)
use TakeUntilExt;
The library supports no_std without allocation or feature flags.
MSRV
The MSRV is 1.85.0 stable.
Publishing
Releases are published to crates.io when a v* tag is pushed. The tag must
exactly match v followed by the version in Cargo.toml. Publishing runs only
after all Rust CI checks and a packaging dry run pass.
The workflow uses trusted publishing to obtain a temporary token; no crates.io API token secret is needed in GitHub.
To release:
-
Update
versioninCargo.tomlto a new, unpublished version. -
Commit the version bump and push the commit containing the publishing workflow.
-
Create and push the matching tag, replacing
X.Y.Zbelow with that version:
Monitor the Publish workflow in GitHub Actions. The current manifest version is
0.2.0; choose a new version before releasing instead of reusing an existing tag.
Performance
The inclusive stopping item lets size_hint() guarantee one item whenever the
underlying iterator guarantees a nonempty remainder.
Run cargo bench --bench fold to compare the default fold() with an experimental
override delegating to the underlying iterator's try_fold(). The override is
kept outside the library because the timing results are inconclusive. See benchmark methodology and results.