//! Saturating integer casts for terminal-UI arithmetic.
//!
//! Terminal dimensions and document line counts are bounded well below
//! `u16::MAX` / `u32::MAX` in any realistic scenario, but clippy's
//! `cast_possible_truncation` lint correctly flags bare `as` casts as
//! potentially lossy. These helpers make the intent explicit and
//! saturate rather than silently wrap on overflow.
/// Saturating cast from `usize` to `u32`.
/// Saturating cast from `usize` to `u16`.
/// Saturating cast from `u32` to `u16`.