Skip to content

Commit c756496

Browse files
committed
Fix clippy::len_without_is_empty
1 parent 5e88763 commit c756496

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
#![allow(
6868
clippy::needless_range_loop,
6969
clippy::ptr_arg,
70-
clippy::len_without_is_empty,
7170
clippy::map_entry,
7271
clippy::type_complexity,
7372
clippy::too_many_arguments,

src/linalg/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ pub trait BaseVector<T: RealNumber>: Clone + Debug {
7676
/// Get number of elevemnt in the vector
7777
fn len(&self) -> usize;
7878

79+
/// Returns true if the vector is empty.
80+
fn is_empty(&self) -> bool {
81+
self.len() == 0
82+
}
83+
7984
/// Return a vector with the elements of the one-dimensional array.
8085
fn to_vec(&self) -> Vec<T>;
8186

0 commit comments

Comments
 (0)