scopefunc 0.1.1

A trait defining kotlin-like scope functions.
Documentation
  • Coverage
  • 0%
    0 out of 5 items documented0 out of 4 items with examples
  • Size
  • Source code size: 3.49 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 130.62 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • statiolake/scopefunc-rs
    1 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • statiolake

scopefunc - use kotlin-like scope functions

Add trait defining kotlin-like scope functions.

Currently provided functions are:

  • transform(): transform value to another.

    let v = gen_rand(0, 10).transform(|v| 'x'.repeat(v));
    // => `v` is random length of "xx...".
    
  • modify(): modify the value and return.

    let v = vec![1, 2, 3].modify(|v| v.push(4));
    // => `v` is [1, 2, 3, 4].