Skip to content

Conversation

A-Manning
Copy link
Contributor

@A-Manning A-Manning commented Sep 15, 2025

Pull Request

What does this PR do?

This PR introduces a safer API for RwIter, as a lending iterator.

It is not possible to keep a reference to the key or data at the current cursor after deleting or inserting at the current cursor. If one chooses not to insert or delete at the current cursor, it is possible to keep a reference to the key or data until the end of the current transaction.
It is only possible to insert at the current cursor with the exact key for the current cursor, which is always owned when inserting. It is not possible to insert at the current cursor after deleting at the current cursor, although it is possible to insert multiple times at the current cursor. It is only possible to insert or delete at the current cursor once the cursor has been initialized via a call to RwIter::next or RwIter::last.

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@A-Manning
Copy link
Contributor Author

CI is failing due to unrelated issues

@Kerollmops
Copy link
Member

Hey @A-Manning 👋

Thank you very much for this work. It's been a long time since I wanted to improve the usage of the RwIter iterator. I'm sorry again for not getting back to you sooner. Please note that I'll need to take a bit more time to review this, as I am currently working on other features to enhance Meilisearch's indexation speed.

@Kerollmops Kerollmops force-pushed the 2025-09-13-lender branch 2 times, most recently from 0072559 to 0056d69 Compare September 30, 2025 14:05
@Kerollmops
Copy link
Member

Hey @A-Manning 👋

I rebased your PR on top of main, and as we can see, the unrelated errors disappear. However, we can also see that the code you added is not compiling. Could you please fix it?

Have a nice day 🌵

@A-Manning A-Manning force-pushed the 2025-09-13-lender branch 2 times, most recently from 79d46c6 to 2bc86bf Compare October 2, 2025 13:40
@A-Manning
Copy link
Contributor Author

@Kerollmops Thanks, I've fixed the doctests

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