itemops 0.1.1

Provides some operations on items of slices
Documentation
  • Coverage
  • 75%
    6 out of 8 items documented0 out of 4 items with examples
  • Size
  • Source code size: 5.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • eukap/itemops
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • eukap

Crates.io

Description

itemops provides some operations on items of Rust language slices.

Examples

For summing elements of a slice with a specified step:

let v = vec![3, 7, 4, 2, 8, 5];

assert_eq!(v.sum_step(2), 15);
assert_eq!(v.sum_step(3), 5);

For multiplying elements of a slice with a specified step:

let a = [2, 5, 1, 6, 3, 7];

assert_eq!(a.product_step(2), 6);
assert_eq!(a.product_step(3), 12);