financial-ops-macros
Procedural macros for financial-ops.
This crate provides the checked! macro, which recursively rewrites an
arithmetic expression into a chain of the standard library's checked arithmetic
methods while preserving operator precedence and grouping.
You normally don't depend on this crate directly — the macro is re-exported as
financial_ops::checked.
use checked;
// Respects precedence: this is `a + (b * c)`, fully checked.
let value: = checked! ;
assert_eq!;
// Overflow short-circuits to `None`.
assert_eq!;
// With `@ error`, you get a `Result` instead.
let result = checked! ;
assert_eq!;