use crate::LeapEntry;
pub const BUILTIN_TABLE: [LeapEntry; 19] = [
LeapEntry::new(0, 19),
LeapEntry::new(46_828_820_000_000_000, 20),
LeapEntry::new(78_364_821_000_000_000, 21),
LeapEntry::new(109_900_822_000_000_000, 22),
LeapEntry::new(173_059_223_000_000_000, 23),
LeapEntry::new(252_028_824_000_000_000, 24),
LeapEntry::new(315_187_225_000_000_000, 25),
LeapEntry::new(346_723_226_000_000_000, 26),
LeapEntry::new(393_984_027_000_000_000, 27),
LeapEntry::new(425_520_028_000_000_000, 28),
LeapEntry::new(457_056_029_000_000_000, 29),
LeapEntry::new(504_489_630_000_000_000, 30),
LeapEntry::new(551_750_431_000_000_000, 31),
LeapEntry::new(599_184_032_000_000_000, 32),
LeapEntry::new(820_108_833_000_000_000, 33),
LeapEntry::new(914_803_234_000_000_000, 34),
LeapEntry::new(1_025_136_035_000_000_000, 35),
LeapEntry::new(1_119_744_036_000_000_000, 36),
LeapEntry::new(1_167_264_037_000_000_000, 37),
];
#[allow(dead_code)]
const fn assert_table_invariants(table: &[LeapEntry]) {
assert!(!table.is_empty(), "BUILTIN_TABLE must not be empty");
let mut i = 1;
while i < table.len() {
assert!(
table[i].tai_nanos > table[i - 1].tai_nanos,
"BUILTIN_TABLE: tai_nanos must be strictly ascending",
);
assert!(
table[i].tai_minus_utc == table[i - 1].tai_minus_utc + 1,
"BUILTIN_TABLE: tai_minus_utc must increment by exactly 1",
);
i += 1;
}
}
const _ASSERT_FIRST_ENTRY: () = {
assert!(
BUILTIN_TABLE[0].tai_nanos == 0,
"BUILTIN_TABLE: first entry must have tai_nanos == 0"
);
assert!(
BUILTIN_TABLE[0].tai_minus_utc == 19,
"BUILTIN_TABLE: first entry must have tai_minus_utc == 19"
);
};
const _ASSERT_TABLE_INVARIANTS: () = assert_table_invariants(&BUILTIN_TABLE);
const _ASSERT_LAST_ENTRY: () = {
let last = BUILTIN_TABLE[BUILTIN_TABLE.len() - 1];
assert!(
last.tai_nanos == 1_167_264_037_000_000_000,
"BUILTIN_TABLE: last entry threshold mismatch"
);
assert!(
last.tai_minus_utc == 37,
"BUILTIN_TABLE: last entry must have tai_minus_utc == 37"
);
};