for_let

Crates.iofor_let
lib.rsfor_let
version0.1.0
sourcesrc
created_at2022-12-22 06:33:10.249378
updated_at2022-12-22 06:33:10.249378
descriptionSyntax sugar for a for-loop + pattern binding
homepage
repositoryhttps://github.com/Desdaemon/for_let
max_upload_size
id743700
size23,023
Viet Dinh (Desdaemon)

documentation

README

for_let

That one syntax sugar library you (may have) wished you wrote yourself.

This library provides the for_let! macro, so you can write code like this:

for_let!(Some(Complex(Pattern(foo))) in iteratee {
    // do stuff
});

Which is just sugar for this:

for el in iteratee {
    match el {
        Some(Complex(Pattern(foo))) => {
            // do stuff
        }
        _ => {}
    }
}

Accepts all patterns that are legal in a match arm. How Pythonic!

Commit count: 3

cargo fmt