You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
doc-comment for IndexedRandom::choose_weighted is wrong for empty sequences #1783
but the function doesn't return an Option; it returns a Result. In particular it seems to return WeightError::InvalidInput if the sequence is empty.
I notice that choose_weighted_iter also is documented to return None in this case despite not returning an Option, but haven't tested the actual behavior. (Probably the same error? Maybe an empty iterator?)
Activity