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

Return iter in get_all_versions #81

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arriqaaq
Copy link
Contributor

@arriqaaq arriqaaq commented Jan 22, 2025

Description

This PR fixes get_all_versions API to return an iterator. This is useful if a key has a large number of versions

@arriqaaq arriqaaq requested a review from gsserge January 22, 2025 07:50
self.values
.iter()
.map(|value| (value.value.clone(), value.version, value.ts))
.collect()
.map(move |value| (self.key.as_slice(), &value.value, value.version, value.ts))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently returning the key to keep the interface uniform by returning the same IterItem everywhere. Do you think it is required here @gsserge ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think key is required here. However, if this operation will participate in merging then we might keep the key to keep the iterators uniform - it's just a slice ref, not a copy. Otherwise let's drop the key.

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.

2 participants