# TSaw
[![Crate][crate_img]][crate]
[![Documentation][docs_img]][docs]
[![License][license_img]][license_file]

Tiny crate to make one-liners easier, so you don't have to declare extra
variables, to use some value twice, turning

```
let result: Vec<String> = " Foo\nbaR"
    .split_whitespace()
    .filter_map(|str| {
        let str = str.trim().to_lowercase();
        (!str.is_empty()).then_some(str)
    })
    .collect();
assert_eq!(result, ["foo", "bar"]);
```

into

```
let result: Vec<String> = " Foo\nbaR"
    .split_whitespace()
    .filter_map(|str|
        str.trim()
            .to_lowercase()
            .tsaw(|str| (!str.is_empty()).then_some(str))
    )
    .collect();
```

so you don't have to
[tap](https://docs.rs/tap/latest/tap/)
[and](https://en.wikipedia.org/wiki/Tap_and_die)
[die](https://en.wikipedia.org/wiki/Death)<sup>citation needed</sup>

Licensed under the Do What The Fuck You Want To Public License (WTFPL)

Copyright (C) 2025 Iris Teyssier <iris.teyssier@gmail.com> 

[crate]: https://crates.io/crates/tsaw "Crate Link"
[crate_img]: https://img.shields.io/crates/v/tsaw.svg?logo=rust "Crate Page"
[docs]: https://docs.rs/tsaw "Documentation"
[docs_img]: https://docs.rs/tsaw/badge.svg "Documentation Display"
[license_file]: https://github.com/mersenne-twister/tsaw/blob/master/LICENSE
[license_img]: https://img.shields.io/crates/l/tsaw.svg "License Display"
