chaining 0.1.0

Adds chaining methods `tap` and `pipe` to every type
Documentation
  • Coverage
  • 80%
    4 out of 5 items documented2 out of 2 items with examples
  • Size
  • Source code size: 3.77 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.09 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • plippe

Chaining

crates.io Released API docs

Adds chaining methods tap and pipe to every type. Inspired by Scala's ChainingOps.

Getting Started

Add chaining to your dependencies in your Cargo.toml file:

[dependencies]
...
chaining = "x.y.z"
...

Examples

use chaining::*;

let times6 = |i: i8| i * 6;
let i = (1 - 2 - 3).pipe(times6).pipe(i8::abs);
assert_eq!(24, i);

let xs = &[1, 2, 3].tap(|xs| println!("debug {}", xs.len()));
assert_eq!(&[1, 2, 3], xs);