Skip to main content

refix_message/
value.rs

1mod date;
2mod decimal;
3mod error;
4mod month_year;
5mod time;
6mod time_precision;
7mod utc_timestamp;
8
9pub use date::Date;
10pub use decimal::Decimal;
11pub use error::{InvalidValue, OutOfRange};
12pub use month_year::MonthYear;
13pub use time::Time;
14pub use time_precision::TimePrecision;
15pub use utc_timestamp::UtcTimestamp;
16
17/// The value of `digits`, if they're all ASCII digits.
18fn number(digits: &[u8]) -> Option<i64> {
19    digits.iter().try_fold(0, |value, &byte| {
20        byte.is_ascii_digit()
21            .then(|| value * 10 + i64::from(byte - b'0'))
22    })
23}