pipe-op 0.0.1

The elixir pipe operator as a macro in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use pipe_op::pipe;

struct Adder {
    value: usize,
}

impl Adder {
    fn add(&self, num: usize) -> usize {
        self.value + num
    }
}

fn main() {
    let s = Adder { value: 10 };
    assert_eq!(11, pipe!(1, s.add()));
}