1 2 3 4 5 6 7 8 9
use std::convert::TryInto; pub(crate) mod deque; pub(crate) mod frequency_sketch; // Ensures the value fits in a range of `128u32..=u32::MAX`. pub(crate) fn sketch_capacity(max_capacity: u64) -> u32 { max_capacity.try_into().unwrap_or(u32::MAX).max(128) }