Implement is_empty method

Clippy warns of missing `is_empty`, trivially implement it by calling
through to `self.data.is_empty()`.
This commit is contained in:
Tobin Harding 2020-12-22 13:35:17 +11:00
parent 1a818ea099
commit 4e87e6fe94
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 5 additions and 0 deletions

View File

@ -61,6 +61,11 @@ impl SharedSecret {
self.len
}
/// True if the underlying data buffer is empty.
pub fn is_empty(&self) -> bool {
self.data.is_empty()
}
/// Set the length of the object.
pub(crate) fn set_len(&mut self, len: usize) {
debug_assert!(len <= self.data.len());