have 0.1.1

Let any type have some fun
Documentation
  • Coverage
  • 33.33%
    1 out of 3 items documented1 out of 3 items with examples
  • Size
  • Source code size: 2.27 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.02 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Canop/have
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Canop

Allow inserting a function on any type in a call chain:

any_type
	.fun(|o| do_something_with(o))
	.other_things();

More detailled example:

use {
    have::Fun,
    itertools::*,
};

fn analyze(log_lines: Vec<LogLine>) {
    log_lines
    	.iter()
        .into_group_map_by(|ll| ll.remote_addr)
        .fun(|g| println!("{} distinct remote_addresses", g.len()))
        .into_iter()
        .sorted_by_key(|e| Reverse(e.1.len()))
        .take(3)
        .for_each(|e| println!("{} hits by remote addresse {}", e.1.len(), e.0));
}

Removal of this crate

I just found out there was already another crate doing exactly the same thing the same way, with added features: tap.

I see no reason not to use the oldest crate. Unless there's an unexpected problem with the tap crate, I suggest you choose it over mine when building a new thing.

Usage:

[dependencies]
have = "0.1"