const_oid/
checked.rs

1//! Checked arithmetic helpers.
2
3/// `const fn`-friendly checked addition helper.
4macro_rules! checked_add {
5    ($a:expr, $b:expr) => {
6        match $a.checked_add($b) {
7            Some(n) => n,
8            None => return Err(Error::Length),
9        }
10    };
11}