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:
Database::set
Database::append
Database::append_duplicate
Database::insert
Database::del
Database::del_item
Database::clear
Anyway, thanks for making the crate. It's really useful!
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:
Database::set
Database::append
Database::append_duplicate
Database::insert
Database::del
Database::del_item
Database::clear
Anyway, thanks for making the crate. It's really useful!