-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Added support for BTreeMap, BTreeSet, BinaryHeap, LinkedList types #6
Conversation
#[inline] | ||
fn deserialize(buf: &mut &[u8]) -> Result<Self> { | ||
let vec = <Vec<T>>::deserialize(buf)?; | ||
Ok(vec.into_iter().collect::<LinkedList<T>>()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code looks beautiful, however do we concern about avoid extra copy and convert cost, if we really want highest performance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is how HashSet was already implemented. I think we can have another round of writing a helper to deserialize into an iterator and thus optimize the performance and avoid duplicate code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, but also consider add tests for newly added types?
…ion is consistent (Map is sorted by key and Set is sorted by value)
…for-more-built-in-types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Resolves #5