Skip to content

Instantly share code, notes, and snippets.

Sven Nilsen bvssvni

View GitHub Profile
@bvssvni
bvssvni / gist:9674632
Last active Sep 24, 2019
A Rust Chain Macro
View gist:9674632
//! Chain macro in Rust
//!
//! A typical usage is to avoid nested match expressions.
//!
//! Supports:
//! - Pattern matching
//! - Or expressions (A | B => ...)
//! - Guarded statements (x if <cond> => ...)
//! - Implicit else (requires all arms to return same type)
View info.md
You can’t perform that action at this time.