summaryrefslogtreecommitdiffstats
path: root/src/metric.rs
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-05-11 11:33:45 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-05-11 11:33:45 -0400
commitadaafdd7043507cbceae65e78c38954e47103b5c (patch)
treec8e2b62b2f39e0f2dc7908ca613df92dd7b541c1 /src/metric.rs
parent825515439247853af3714d3135051a83bd84d2e0 (diff)
downloadkd-forest-adaafdd7043507cbceae65e78c38954e47103b5c.tar.xz
Fix some clippy lints
Diffstat (limited to 'src/metric.rs')
-rw-r--r--src/metric.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/metric.rs b/src/metric.rs
index d37d2bf..d9938e4 100644
--- a/src/metric.rs
+++ b/src/metric.rs
@@ -373,6 +373,17 @@ impl<T> ExhaustiveSearch<T> {
pub fn len(&self) -> usize {
self.0.len()
}
+
+ /// Check if this index is empty.
+ pub fn is_empty(&self) -> bool {
+ self.0.is_empty()
+ }
+}
+
+impl<T> Default for ExhaustiveSearch<T> {
+ fn default() -> Self {
+ Self::new()
+ }
}
impl<T> FromIterator<T> for ExhaustiveSearch<T> {