1 unstable release

0.1.0 May 5, 2020

#780 in Programming languages

ISC license

6KB
103 lines

pipe_macro

This crate provides a macro to pipe function calls like in some functional programming languages.

Examples

fn add(a: usize, b: usize) -> usize {
    a + b
}

fn double(a: usize) -> usize {
    a * 2
}

let answer = pipe!(
    2
    => double
    => { |n| add(n, 10) }
    => double
);

assert_eq!(answer, 28);
let count = pipe!("https://rust-lang.org" => download.await? => parse? => count_links);

No runtime deps