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
-1
View File
@@ -67,7 +67,6 @@
#![allow( #![allow(
clippy::needless_range_loop, clippy::needless_range_loop,
clippy::ptr_arg, clippy::ptr_arg,
clippy::len_without_is_empty,
clippy::map_entry, clippy::map_entry,
clippy::type_complexity, clippy::type_complexity,
clippy::too_many_arguments, clippy::too_many_arguments,
+5
View File
@@ -76,6 +76,11 @@ pub trait BaseVector<T: RealNumber>: Clone + Debug {
/// Get number of elevemnt in the vector /// Get number of elevemnt in the vector
fn len(&self) -> usize; 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. /// Return a vector with the elements of the one-dimensional array.
fn to_vec(&self) -> Vec<T>; fn to_vec(&self) -> Vec<T>;