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 error result only from Iterator.next() #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mykmelez
Copy link
Contributor

@mykmelez mykmelez commented Jan 8, 2019

@danburkert This improves on the approach in #45, based on feedback from a colleague of mine. Instead of using a trait object, which would introduce dynamic dispatch, it uses an enum to represent the two kinds of iterator, returning the Iter::Err variant from the Cursor.iter*() methods if they fail.

Thus it enables the Cursor.iter*() methods to become infallible while avoiding dynamic dispatch.

stuhood pushed a commit to pantsbuild/lmdb-rs that referenced this pull request Jan 25, 2022
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