add a nested hashmap#24
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new LookupMap<K1, K2, V> data structure to the db-rs library, implementing a nested HashMap pattern (HashMap<K1, HashMap<K2, V>>). This follows the established pattern of specialized lookup table types like LookupList and LookupSet.
Changes:
- Adds
LookupMapimplementation with support for two-level key-value storage - Includes comprehensive tests covering insert, remove, create_key, and clear_key operations
- Exports the new type in the library's public API
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| db/src/lookup_map.rs | Core implementation of LookupMap with Table trait, LogEntry enum, and public API methods |
| db/tests/lookup_map_tests.rs | Test suite covering basic operations, persistence, and edge cases |
| db/src/lib.rs | Module declaration and public export of LookupMap |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Parth
left a comment
There was a problem hiding this comment.
copilot is right about the comment which says that the tests need to have unique directories and run in parallel.
I was lazy about it and didn't feel the need to introduce something like uuid to the deps, but consider making some "random" test function to fix the issue.
The code looks fine and the tests did pass, so I'll release this from your branch, but fix this before you merge it
|
415bce9 is released as 0.3.4 |
HashMap<K1, HashMap<K2, V>>