itemops

Crates.ioitemops
lib.rsitemops
version0.1.1
sourcesrc
created_at2019-09-06 15:28:17.705869
updated_at2020-02-12 23:46:48.08993
descriptionProvides some operations on items of slices
homepage
repositoryhttps://github.com/eukap/itemops
max_upload_size
id162804
size5,675
Eugene Kapshuk (eukap)

documentation

README

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);
Commit count: 15

cargo fmt