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
It seems possible to share most of the code from permutations(), similar to the array_combinations() implementation. In that case we probably want to start with:
Activity
ronnodas commentedon Jan 4, 2025
It may be easier to add
array_permutations()
if you want to avoid macro hackery.JonathanBrouwer commentedon Jan 4, 2025
That's true and in general probably nicer to use than tuples, thanks for the pointer!
ronnodas commentedon Jan 6, 2025
It seems possible to share most of the code from
permutations()
, similar to thearray_combinations()
implementation. In that case we probably want to start with:and then make
PermutationState
generic. (Aside: I'm not sure whyPermutationState::Loaded.indices
is aBox<[usize]>
instead of aVec<usize>
.)phimuemue commentedon Jan 7, 2025
Canonically we use
Box<[usize]>
if the size stays unchanged.array_permutations()
#1013array_permutations
(attempt 2) #1014