#core #addition #numbers #gcd #digits #count #greatest

yanked dish

Addition to core

1 unstable release

0.0.1 Dec 27, 2022

#7 in #greatest

MPL-2.0 license

15KB
437 lines

crates.io License Documentation

dish

dish provides several extensions for Rust's libcore.

Examples:

Find greatest count divisor of minimal and maximal numbers in a vector of usize:

use dish::prelude::*;

fn mmgcd(src: Vec<usize>) -> usize {
    src.into_iter()
       .min_max_pipe(Number::gcd)
       .unwrap()
}

Find sum of all digits of a number:

use dish::prelude::*;

fn dgsum<T: Number>(n: T) -> u8 {
    n.digits()
     .sum()
}

lib.rs:

dish provides several additions to libcore.

No runtime deps