Skip to main content

days_to_index

Function days_to_index 

pub(crate) fn days_to_index(days: i64) -> u32
Expand description

Converts a non-negative day count to u32, for indexing a per-day table.

§Panics

Panics if days is negative or exceeds u32::MAX. Callers index a calendar’s own day table, whose span they constructed, so either condition means the index was derived from a date outside that calendar — a bug, not a recoverable input error.