Skip to content

Commit 8402eec

Browse files
committed
Document the presence of u64 for NumericError
1 parent 3a05d95 commit 8402eec

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

types/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ pub fn to_u64(value: i64, field: &str) -> Result<u64, NumericError> {
6868
u64::try_from(value).map_err(|_| NumericError::Negative { value, field: field.to_owned() })
6969
}
7070

71-
/// Error converting an `i64` to a `u32`.
71+
/// Error converting an `i64` to a `u32` or `u64`.
7272
///
73-
/// If we expect a numeric value to sanely fit inside a `u32` we use that type in the `model`
74-
/// module, this requires converting the `i64` returned by the JSONRPC API into a `u32`, if our
75-
/// expectations are not met this error will be encountered.
73+
/// The JSONRPC API returns `i64` values. If these values match our expectations, then
74+
/// we convert them to either `u32` or `u64`, depending on the JSONRPC field. If our
75+
/// expectations are not met, this error is returned.
7676
#[derive(Debug)]
7777
pub enum NumericError {
7878
/// Expected an unsigned numeric value however the value was negative.

0 commit comments

Comments
 (0)