#[must_use]
pub fn redundant_offset(per_key_last_snapshot: &[i64]) -> Option<i64> {
per_key_last_snapshot.iter().copied().min()
}
#[cfg(test)]
mod tests {
use super::*;
use assert2::assert;
#[test]
fn empty_is_none() {
assert!(redundant_offset(&[]).is_none());
}
#[test]
fn single_key_is_itself() {
assert!(redundant_offset(&[42]) == Some(42));
}
#[test]
fn picks_minimum() {
assert!(redundant_offset(&[100, 30, 75, 30, 200]) == Some(30));
}
#[test]
fn min_includes_zero() {
assert!(redundant_offset(&[0, 5, 9]) == Some(0));
}
}