unwrap_checked

Macro unwrap_checked 

Source
macro_rules! unwrap_checked {
    ($body:block $(,)?) => { ... };
}
Expand description

Unwraps the result of a block of checked integer math.

ยงExample

let result = unwrap_checked!({
  let one: u64 = 1;
  let three: u64 = 3;
  one.checked_add(three)
});
assert_eq!(result, 4);