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

Implement range_de for SnapshotMap #497

Merged
merged 1 commit into from
Oct 18, 2021
Merged

Implement range_de for SnapshotMap #497

merged 1 commit into from
Oct 18, 2021

Conversation

uint
Copy link
Contributor

@uint uint commented Oct 18, 2021

Deals with #461, but doesn't close it

Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a quick look and it seems correct to me.

Maybe @maurolacy can give some feedback as you work on porting this to the IndexedMap types. (And I guess we would want such range_de on the indexes??? but that is definitely a separate PR. glad to have a few smaller PRs that can get reviewed and merged quickly.)

.range_de(&store, None, None, Order::Ascending)
.collect();
let all = all.unwrap();
assert_eq!(2, all.len());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to remove this.
The next check also asserts this, but gives more info on failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. We do this in other places I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we started removing some of those in recent PR reviews, which is why I point this out.

Nice to read other PR reviews also to see discussions on APIs and best practices... I think that is where the code style really gets hashed out

.collect();
let all = all.unwrap();
assert_eq!(2, all.len());
assert_eq!(all, vec![(b"C".to_vec(), 13), (b"D".to_vec(), 22)]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice demo showing the deserialisation.

@uint
Copy link
Contributor Author

uint commented Oct 18, 2021

Took a quick look and it seems correct to me.

Maybe @maurolacy can give some feedback as you work on porting this to the IndexedMap types. (And I guess we would want such range_de on the indexes??? but that is definitely a separate PR. glad to have a few smaller PRs that can get reviewed and merged quickly.)

One thing I'm wondering is if we have a desired representation when serializing IndexedMap type stuff, or if it's just a matter of it being consistent with how it's deserialized.

@uint uint marked this pull request as ready for review October 18, 2021 17:49
@uint uint requested a review from maurolacy October 18, 2021 17:50
Copy link
Contributor

@maurolacy maurolacy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm.

@ethanfrey ethanfrey merged commit ee0e2a9 into main Oct 18, 2021
@ethanfrey ethanfrey deleted the 461-range_de branch October 18, 2021 18:46
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.

3 participants