-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
contains_key returns true even if key does not exist. #1441
Labels
Comments
fn contains_key(&self, key: &str) -> bool {
match self.db.contains_key(key) {
Err(e) => false,
Ok(v) => v,
}
} |
Sorry, you can change that to match the actual API, it will still return true for both cases. whether key exists or does not exist. I tried to simplify code that I copied here and I forgot to change it for match. I am using .get() to be able to determine if key exists or not. |
fn contains_key(&self, key: &str) -> bool {
match self.db.contains_key(key) {
Err(e) => false,
Ok(v) => v, // attention here
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried to prototype with sled db and the contains_key API always returns true even though the key does not exist.
The text was updated successfully, but these errors were encountered: