Function best_size

Source
pub fn best_size(size_hint: (usize, Option<usize>)) -> usize
Expand description

Calculates the best size from an iterator’s size hint.

This function prefers the upper bound of a size hint if it exists, otherwise it falls back to the lower bound. This is useful for pre-allocating capacity or setting progress bar lengths.