Check if key are not empty in validator

This commit is contained in:
many 2021-09-08 15:24:32 +02:00
parent 772e55d174
commit d18ee58ab9
No known key found for this signature in database
GPG Key ID: 2CEF23B75189EACA

View File

@ -17,7 +17,7 @@ pub use merge_functions::{
}; };
pub fn valid_lmdb_key(key: impl AsRef<[u8]>) -> bool { pub fn valid_lmdb_key(key: impl AsRef<[u8]>) -> bool {
key.as_ref().len() <= 511 key.as_ref().len() <= 511 && !key.as_ref().is_empty()
} }
/// Divides one slice into two at an index, returns `None` if mid is out of bounds. /// Divides one slice into two at an index, returns `None` if mid is out of bounds.