From 1cb9fabadeeb2a6e259a5031cdc5bffbb9680b25 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 19 Jun 2026 11:36:46 +0100 Subject: [PATCH] Comment why as i64 is safe --- rust/src/events/serialize.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/src/events/serialize.rs b/rust/src/events/serialize.rs index de8847a038..758fd103f3 100644 --- a/rust/src/events/serialize.rs +++ b/rust/src/events/serialize.rs @@ -584,6 +584,9 @@ fn serialize_event_value( if let Some(sticky_duration) = event.sticky_duration() { // min() ensures the origin server can't claim a time in the future // to exceed the stickiness duration limit. + // + // The `as i64` cast is safe as sticky duration are capped to an + // hour, which is well within the i64 range. let expires_at = std::cmp::min(event.origin_server_ts(), time_now_ms) + sticky_duration.as_millis() as i64; if expires_at > time_now_ms {