Check
Convenience assert!-like macros which immediately return None or Err(...)
instead of panicking.
In a function returning an Option<T>, invoke the macro with just enough
parameters to get a condition to check.
check!;
check_eq!;
This will expand to:
if !
if a != b
In a function returning a Result<T, E>, invoke the macro with an extra
argument, which is the error to return if the check fails (and must have type
E), just like you can add arguments to choose a panic message with assert!.
check!;
check_eq!;
This will expand to:
if !
if a != b