Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Finally getting back to cleaning up the raw table API, and this is one of the things I wanted to do properly.
Essentially, while
InsertSlotis moderately useful to ensure that indices are used correctly, it doesn't really hold its weight as an API and also is a bit misleading: it doesn't actually contain the insertion slot (i.e. pointer), just an index to it. So, this removes theInsertSlottype and renames the relevant APIs to refer to an "insert index" instead of an "insert slot."I mostly hastily searched for the word "slot" to reword comments as necessary, although the term "slot" to refer to an actual position in the HashTable should be unchanged. To be clear, the goal of this change is to have "slot" mean the physical location in the table, and "index" refer to the specific index to obtain that location, given a table.
Note that a future addition is to also remove the
Buckettype, replacing it withusize,*mut T, or&mut MaybeUninit<T>where appropriate. However, I wanted to avoid stacking too many changes at once, so, this just starts withInsertSlot.