Function usize_to_i64
Source pub fn usize_to_i64(value: usize, value_name: &str) -> Result<i64>
Expand description
Converts usize values such as Vec::len() or byte-slice lengths to i64.
This is infallible only on 32-bit platforms, but the fallible signature keeps call sites
consistent with the other checked conversions.
ยงErrors
Returns an error when value exceeds i64::MAX.