Expand description
§loop_unwrap
Provides utility macros for unwrapping during loops.
Macros§
- unwrap_
break - Works like
.unwrap
, if it’s an Err or None, it callsbreak
on the loop. Prints an error message withprintln!()
if provided. Loop Label can be provided in any order besides the Result/Option being the first argument. If loop label is proivded, the specified loop will be break;-ed. - unwrap_
break_ err - Works only on Result enum. If the value is Err(e), breaks the loop returning Err(e). Otherwise, it unwraps and the code continues. Supports loop labels.
- unwrap_
continue - Works like
.unwrap
, if it’s an Err or None, it callscontinue
on the loop. Prints an error message withprintln!()
if provided. Loop Label can be provided in any order besides the Result/Option being the first argument. If loop label is proivded, the specified loop will be continued.