zip_eq 0.1.0

Zip iterator that check that its inputs have the same length.
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented1 out of 5 items with examples
  • Size
  • Source code size: 47.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.17 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • sarah-quinones/zip-eq
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • sarah-quinones

zip-eq

A zip iterator that checks that its inputs have the same lengths, either eagerly at the moment of construction, or lazily.

Examples

Eager check

use zip_eq::ZipEq;
                                         
let a = [1, 2];
let b = [3, 4];
let mut zipped = a.zip_eq_eager(b); // length check happens here
                                         
assert_eq!(zipped.next(), Some((1, 3)));
assert_eq!(zipped.next(), Some((2, 4)));
assert_eq!(zipped.next(), None);

Lazy check

use zip_eq::ZipEq;
                                         
let a = [1, 2];
let b = [3, 4];
let mut zipped = a.zip_eq_lazy(b);
                                         
assert_eq!(zipped.next(), Some((1, 3)));
assert_eq!(zipped.next(), Some((2, 4)));
assert_eq!(zipped.next(), None); // length check happens here