chainable-if
This crate provides the if_chain! macro -- a macro for composing
long chains of if-else if-else statements.
It is intended to provide an alternative to writing if chains with match,
such as:
match
Example usage
While it is mainly intended for long chains, if_chain! can be used
for simple if-else situations, such as:
if_chain!
The earlier match example can be rewritten as:
if_chain!
Note that the else branch is not required, since if_chain! simply gets
expanded into:
if some_condition else if some_other_condition }
...
} else if some_third_condition