[][src]Crate ward

This crate exports two macros, which are intended to replicate the functionality of Swift's guard expression with Option<T>. They both do similar things, but the ward! macro technically has more use cases than the guard! macro, because it returns a value instead of creating a variable.

Macros

guard

Creates a variable with the contents of a Option<T>'s Some(T), otherwise it returns early from the function.

ward

Returns the contents of a Option<T>'s Some(T), otherwise it returns early from the function.