From c451cf161d344965539f4c9617caf31d7f58ab18 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Fri, 14 Nov 2025 09:47:11 +0000 Subject: [PATCH 1/3] Fix is_empty method logic in matrix.rs --- src/linalg/basic/matrix.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linalg/basic/matrix.rs b/src/linalg/basic/matrix.rs index 1a4ae4dc..58f9846a 100644 --- a/src/linalg/basic/matrix.rs +++ b/src/linalg/basic/matrix.rs @@ -385,7 +385,7 @@ impl Array for DenseMatrix } fn is_empty(&self) -> bool { - self.ncols > 0 && self.nrows > 0 + self.ncols < 1 || self.nrows < 1 } fn iterator<'b>(&'b self, axis: u8) -> Box + 'b> { From c2815239390f73dae3b0ce19cca5498856392dfe Mon Sep 17 00:00:00 2001 From: Lorenzo Mec-iS Date: Sat, 15 Nov 2025 05:06:42 +0000 Subject: [PATCH 2/3] bump to 0.4.6 --- Cargo.toml | 2 +- src/algorithm/neighbour/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 77343155..9b5bf8b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "smartcore" description = "Machine Learning in Rust." homepage = "https://smartcorelib.org" -version = "0.4.5" +version = "0.4.6" authors = ["smartcore Developers"] edition = "2021" license = "Apache-2.0" diff --git a/src/algorithm/neighbour/mod.rs b/src/algorithm/neighbour/mod.rs index c13e914a..4a60365b 100644 --- a/src/algorithm/neighbour/mod.rs +++ b/src/algorithm/neighbour/mod.rs @@ -1,4 +1,4 @@ -#![allow(clippy::ptr_arg)] +#![allow(clippy::ptr_arg, clippy::needless_range_loop)] //! # Nearest Neighbors Search Algorithms and Data Structures //! //! Nearest neighbor search is a basic computational tool that is particularly relevant to machine learning, From f2cc564096001478735b4308dac0233038cde42a Mon Sep 17 00:00:00 2001 From: Lorenzo Mec-iS Date: Sat, 15 Nov 2025 05:11:08 +0000 Subject: [PATCH 3/3] silence some clippy --- src/cluster/mod.rs | 1 + src/dataset/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/cluster/mod.rs b/src/cluster/mod.rs index eb8c39ff..a268f50c 100644 --- a/src/cluster/mod.rs +++ b/src/cluster/mod.rs @@ -1,3 +1,4 @@ +#![allow(clippy::ptr_arg, clippy::needless_range_loop)] //! # Clustering //! //! Clustering is the type of unsupervised learning where you divide the population or data points into a number of groups such that data points in the same groups diff --git a/src/dataset/mod.rs b/src/dataset/mod.rs index d7d456c6..91628942 100644 --- a/src/dataset/mod.rs +++ b/src/dataset/mod.rs @@ -1,3 +1,4 @@ +#![allow(clippy::ptr_arg, clippy::needless_range_loop)] //! Datasets //! //! In this module you will find small datasets that are used in `smartcore` mostly for demonstration purposes.