Fix clippy::len_without_is_empty

This commit is contained in:
Luis Moreno
2020-11-09 00:21:02 -04:00
parent 5e887634db
commit c756496b71
2 changed files with 5 additions and 1 deletions
+5
View File
@@ -76,6 +76,11 @@ pub trait BaseVector<T: RealNumber>: Clone + Debug {
/// Get number of elevemnt in the vector
fn len(&self) -> usize;
/// Returns true if the vector is empty.
fn is_empty(&self) -> bool {
self.len() == 0
}
/// Return a vector with the elements of the one-dimensional array.
fn to_vec(&self) -> Vec<T>;