Skip to content

Refactor Keys and Values iterators to only have one type parameter. - #4

Open
reem wants to merge 1 commit into
contain-rs:masterfrom
reem:keys-values-iterator-refactor
Open

Refactor Keys and Values iterators to only have one type parameter.#4
reem wants to merge 1 commit into
contain-rs:masterfrom
reem:keys-values-iterator-refactor

Conversation

@reem

@reem reem commented Nov 23, 2015

Copy link
Copy Markdown
Member

Review on Reviewable

@apasel422

Copy link
Copy Markdown

Is there a way to reduce the duplication of the RawKeyBucket and RawValueBucket structs and their impls with a generic type?

Edit: It seems like we can just replace those structs with a single RawItemBucket<T> struct and a single set of generic impls?

@Gankra

Gankra commented Nov 24, 2015

Copy link
Copy Markdown

I'm not sure it's advisable to make the source of this deviate this substantially from std. I was under the impression that this was largely intended to just add missing APIs.

@reem

reem commented Nov 24, 2015

Copy link
Copy Markdown
Member Author

Yeah, this has just bugged me for a while and I don't think it's possible to fix in std (it would be a breaking change).

@bluss

bluss commented Nov 28, 2015

Copy link
Copy Markdown

Just philosophizing, but having both the K and V parameters means that the internal memory layout has greater freedom to change, so in that sense dropping them is limiting future internal refactoring.

@reem

reem commented Nov 28, 2015

Copy link
Copy Markdown
Member Author

@bluss this is true. I originally figured I would need to erase the key/value type by storing its size, I only later discovered it's unnecessary right now.

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.

4 participants