Add `shrink_to_fit`
Closes #19. I didn't implement shrink_to since it is unstable.
I also simplified the implementation of clear, since I noticed it was possible; there are a few other minor changes from rustfmt too.
Any chance this will land? It makes a huge difference to memory usage.
This needs a rebase, and I'd also feel more confident in the correctness of the free list handling if shrink_to_fit were integrated into the quickchecks. Happy to merge when those things happen.
I can manage the rebase, but need guidance regarding to the 'quickchecks'. What are they? Where are they?
Here you go:
https://github.com/fitzgen/generational-arena/blob/master/tests/quickchecks.rs
https://docs.rs/quickcheck/1.0.3/quickcheck/