2 releases

0.1.1 Jan 25, 2021
0.1.0 Jan 22, 2021

#1996 in Rust patterns

39 downloads per month
Used in rhit

MIT license


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

	.fun(|o| do_something_with(o))

More detailled example:

use {

fn analyze(log_lines: Vec<LogLine>) {
        .into_group_map_by(|ll| ll.remote_addr)
        .fun(|g| println!("{} distinct remote_addresses", g.len()))
        .sorted_by_key(|e| Reverse(e.1.len()))
        .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.


have = "0.1"


Make any type have some fun.

This is convenient when you want to insert some function call in a chain without reordering it or create intermediate variables.

use have::Fun;

let sum = [1, 2, 3]
    .fun(|v| println!("v is size {}", v.len()))

No runtime deps