MCPcopy Create free account
hub / github.com/ccusage/ccusage / parse_digits

Function parse_digits

rust/crates/ccusage/src/date_utils.rs:169–178  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

167}
168
169pub(crate) fn parse_digits(bytes: &[u8]) -> Option<u32> {
170 let mut value = 0;
171 for byte in bytes {
172 if !byte.is_ascii_digit() {
173 return None;
174 }
175 value = value * 10 + u32::from(byte - b'0');
176 }
177 Some(value)
178}
179
180pub(crate) fn days_in_month(year: i32, month: u32) -> u32 {
181 match month {

Callers 3

parse_ts_timestampFunction · 0.85
parse_timezone_offsetFunction · 0.85
parse_iso_dateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected