diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2021-10-21 14:01:21 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2021-10-24 10:51:11 -0400 |
commit | d64807aab65a4e25012c639b28d5ac60e24dac32 (patch) | |
tree | 4096be26b0b56331d477109b3a7a791d5f6aed6a | |
parent | bf2a10ca3b54ac3ed3dcc9c25cb1cf7f07ba8135 (diff) | |
download | acap-d64807aab65a4e25012c639b28d5ac60e24dac32.tar.xz |
Bump the edition to 2021
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | benches/benches.rs | 2 | ||||
-rw-r--r-- | src/cos.rs | 2 | ||||
-rw-r--r-- | src/euclid.rs | 2 | ||||
-rw-r--r-- | src/exhaustive.rs | 2 | ||||
-rw-r--r-- | src/kd.rs | 2 | ||||
-rw-r--r-- | src/knn.rs | 4 | ||||
-rw-r--r-- | src/vp.rs | 1 |
8 files changed, 1 insertions, 16 deletions
@@ -2,7 +2,7 @@ name = "acap" version = "0.2.0" authors = ["Tavian Barnes <tavianator@tavianator.com>"] -edition = "2018" +edition = "2021" description = "As Close As Possible — nearest neighbor search in Rust." readme = "README.md" repository = "https://github.com/tavianator/acap" diff --git a/benches/benches.rs b/benches/benches.rs index 07d21b3..e0001ac 100644 --- a/benches/benches.rs +++ b/benches/benches.rs @@ -8,8 +8,6 @@ use acap::vp::{FlatVpTree, VpTree}; use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion}; -use std::iter::FromIterator; - type Point = Euclidean<[f32; 3]>; /// Generates a spiral used as the benchmark data set. @@ -7,7 +7,6 @@ use num_traits::real::Real; use num_traits::{one, zero}; use std::cmp::Ordering; -use std::convert::TryFrom; /// Compute the [cosine *similarity*] between two points. /// @@ -398,7 +397,6 @@ where /// /// # use acap::distance::Distance; /// # use acap::cos::AngularDistance; -/// # use std::convert::TryFrom; /// let zero = AngularDistance::from_cos(1.0); /// let pi_2 = AngularDistance::from_cos(0.0); /// let pi = AngularDistance::from_cos(-1.0); diff --git a/src/euclid.rs b/src/euclid.rs index 3ec0af9..e1ee3c9 100644 --- a/src/euclid.rs +++ b/src/euclid.rs @@ -7,7 +7,6 @@ use crate::lp::Minkowski; use num_traits::zero; use std::cmp::Ordering; -use std::convert::TryFrom; /// A point in Euclidean space. /// @@ -155,7 +154,6 @@ where /// /// # use acap::distance::Distance; /// # use acap::euclid::EuclideanDistance; -/// # use std::convert::TryFrom; /// let a = EuclideanDistance::try_from(3).unwrap(); /// let b = EuclideanDistance::try_from(4).unwrap(); /// let c = EuclideanDistance::from_squared(a.squared_value() + b.squared_value()); diff --git a/src/exhaustive.rs b/src/exhaustive.rs index 3f42876..7b63ef7 100644 --- a/src/exhaustive.rs +++ b/src/exhaustive.rs @@ -3,8 +3,6 @@ use crate::distance::Proximity; use crate::knn::{ExactNeighbors, NearestNeighbors, Neighborhood}; -use std::iter::FromIterator; - /// A [`NearestNeighbors`] implementation that does exhaustive search. #[derive(Clone, Debug)] pub struct ExhaustiveSearch<T>(Vec<T>); @@ -8,8 +8,6 @@ use crate::util::Ordered; use num_traits::Signed; -use std::iter::FromIterator; - /// A node in a k-d tree. #[derive(Debug)] struct KdNode<T> { @@ -2,8 +2,6 @@ use crate::distance::{Distance, Proximity}; -use std::convert::TryInto; - /// A nearest neighbor. #[derive(Clone, Copy, Debug)] pub struct Neighbor<V, D> { @@ -353,8 +351,6 @@ pub mod tests { use rand::prelude::*; - use std::iter::FromIterator; - type Point = Euclidean<[f32; 3]>; /// Test an [ExactNeighbors] implementation. @@ -7,7 +7,6 @@ use crate::util::Ordered; use num_traits::zero; use std::fmt::{self, Debug, Formatter}; -use std::iter::{Extend, FromIterator}; /// A node in a VP tree. #[derive(Debug)] |