Sign in
android
/
platform
/
external
/
rust
/
crates
/
const-oid
/
56987e0eefa7be46a7ed000af48ae68e644d0a31
/
.
/
src
/
checked.rs
blob: 7ff16a2a7b339df28a8c1b40e2f6d4e86f4dc96e [
file
] [
log
] [
blame
]
//! Checked arithmetic helpers.
/// `const fn`-friendly checked addition helper.
macro_rules
!
checked_add
{
(
$a
:
expr
,
$b
:
expr
)
=>
{
match
$a
.
checked_add
(
$b
)
{
Some
(
n
)
=>
n
,
None
=>
return
Err
(
Error
::
Length
),
}
};
}