Skip to main content

saturating_u32

Function saturating_u32 

Source
fn saturating_u32(v: usize) -> u32
Expand description

Convert a usize (line/column/length in the document) into the u32 width required by the LSP semantic-token wire format. No-op on values below u32::MAX; saturates otherwise. LSP positions are specified to be u32, so any document large enough to saturate is already unrepresentable.