Skip to content

WaffleLapkin/arraylib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arraylib

CI status Telegram crates.io documentation (docs.rs) documentation (master) LICENSE

arraylib provides tools for working with arrays. See docs for more.

[dependencies]
arraylib = "0.3"

Compiler support: requires rustc 1.41+

Examples

use arraylib::{Array, ArrayMap, ArrayExt};
// Array creation
let arr = <[_; 11]>::unfold(1, |it| {
    let res = *it;
    *it *= -2;
    res
});

// Mapping
let arr = arr.map(|it| it * 2);
assert_eq!(arr, [2, -4, 8, -16, 32, -64, 128, -256, 512, -1024, 2048]);

// By-value iterator
arr.iter_move().for_each(|i: i32| {})