Skip to content
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

Reworked the internal of this library. #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

hbina
Copy link

@hbina hbina commented Aug 18, 2020

Hi! I am trying to learn more advanced concepts in Rust and I took to reworking the internals of this library.
In particular, I have done:

  1. Attempting to implement some of the functions requested here Adding SmallSet servo/rust-smallvec#220 .
    I have already implemented some of the easy ones.

  2. Make SmallVec a wrapper over an enum of SmallVec and HashSet. The size of this union should be about the same and it wont cause O(n) operating when its spilling into the heap.

  3. Implement some traits like PartialEq and Debug.

What do you think? Any feedback/review is appreciated!

@hbina hbina force-pushed the issue_220 branch 2 times, most recently from 14e4d52 to 1269182 Compare August 19, 2020 11:06
Implemented some helper functions

Partially implemented some of the easier functions from here
servo/rust-smallvec#220 (comment)

Implemented `PartialEq` for SmallSet

Added tests for `replace`.

nitpick from Intellij Rust

SmallSet is now a wrapper over enum of SmallVec and HashSet

Insertion now moves to a heap allocated HashSet when capacity.

Fixed compilation error from previous commit

Might want to merge this two later.

Cleared now changes to stack.

Implemented drain

Moved tests and updated them.

Updated tests.

Fixed set equality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant