I have
```rust
        for (i, count_i) in count.mut_iter().enumerate().skip(1) {
            let mut it = perm.mut_iter().take(i + 1);
            let mut prev = it.next().unwrap();
            let perm0 = *prev;
            for cur in it {
                *prev = *cur;
                prev = cur;
            }
            *prev = perm0;

            if *count_i >= i {
                *count_i = 0;
            } else {
                *count_i += 1;
                break;
            }
        }
```
But it's much slower that the safe version with indices :(

As the safe version with indices is just a little bit slower than the unsafe version. I'll commit the safe version with indices.