Function safe_sub
Source pub fn safe_sub<T: SafeSub>(a: T, b: T) -> Result<T, SafeMathError>
Expand description
Performs safe subtraction with underflow checking.
Used internally by the #[safe_math] macro during expansion.
This function delegates to the appropriate trait method.
§Arguments
a - First operand.
b - Second operand.
§Returns
Ok(result) on success, Err(SafeMathError::Overflow) on error.