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

Use "&mut self" in methods writing to Database #51

Closed
wants to merge 1 commit into from
Closed

Use "&mut self" in methods writing to Database #51

wants to merge 1 commit into from

Conversation

radupopescu
Copy link

This patch only modifies the methods modifying Database object, making them take &mut self as a parameter. This prevents the situation described in #48, where it's possible to have both a read-only reference and a writable reference to the same element.

I've fixed the compilation of the tests - it can be seen that the API changes introduced here are minimal.

The following functions were modified:

  1. Database::set
  2. Database::append
  3. Database::append_duplicate
  4. Database::insert
  5. Database::del
  6. Database::del_item
  7. Database::clear

Anyway, thanks for making the crate. It's really useful!

@radupopescu
Copy link
Author

I made a mistake.

These changes are not enough to prevent the problem described. I'm closing this while I think about it.

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