pub fn get_total_weight<T>(items: &[T], weight: impl Fn(&T) -> i32) -> i32
Sums weight over items.
weight
items
Panics if the sum exceeds i32::MAX.
i32::MAX