0.1.3 |
|
---|---|
0.1.2 |
|
0.1.1 |
|
0.1.0 |
|
#157 in #closures
6KB
100 行
lazy-pipe
将闭包链式调用组合成管道
用法
let expected = ((3 + 1) / 2).to_string();
let received = pipe(3)
.map(|x| x + 1)
.map(|x| x / 2)
.map(|x| x.to_string())
.unwrap();
assert_eq!(received, expected);