pure-iter 0.1.1

Iterator adapter without side-effects, possible better performance
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented2 out of 3 items with examples
  • Size
  • Source code size: 8.07 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 374.04 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • A4-Tacks/pure-iter-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • A4-Tacks

Iterator adapter without side-effects, possible better performance

Examples

use std::sync::atomic::{AtomicU32, Ordering::*};
use pure_iter::PureIterExt;

let mut a = AtomicU32::new(0);
let mut b = AtomicU32::new(0);

let c = (0..3).map(|_| a.fetch_add(1, Release)).nth(2);
let d = (0..3).pure_map(|_| b.fetch_add(1, Release)).nth(2);

assert_eq!(c, Some(2));
assert_eq!(d, Some(0));

assert_eq!(a.load(Acquire), 3);
assert_eq!(b.load(Acquire), 1);