diff options
author | IshitaTakeshi <ishitah.takeshi@gmail.com> | 2024-05-15 18:02:22 +0900 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-02-18 10:34:38 -0500 |
commit | b4c25f17cd8d75f05123928e47f44dd56275749f (patch) | |
tree | f39e279a0d412dd0ce372ed865d33d423732c9bc /src/exhaustive.rs | |
parent | 17f118fbc74a26f55a5263e616faeb20368de9d0 (diff) | |
download | acap-b4c25f17cd8d75f05123928e47f44dd56275749f.tar.xz |
Make this crate work with no-std
Diffstat (limited to 'src/exhaustive.rs')
-rw-r--r-- | src/exhaustive.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/exhaustive.rs b/src/exhaustive.rs index 7b63ef7..bfddeb1 100644 --- a/src/exhaustive.rs +++ b/src/exhaustive.rs @@ -3,6 +3,8 @@ use crate::distance::Proximity; use crate::knn::{ExactNeighbors, NearestNeighbors, Neighborhood}; +use alloc::vec::Vec; + /// A [`NearestNeighbors`] implementation that does exhaustive search. #[derive(Clone, Debug)] pub struct ExhaustiveSearch<T>(Vec<T>); @@ -48,7 +50,7 @@ impl<T> FromIterator<T> for ExhaustiveSearch<T> { /// An iterator that moves values out of an exhaustive index. #[derive(Debug)] -pub struct IntoIter<T>(std::vec::IntoIter<T>); +pub struct IntoIter<T>(alloc::vec::IntoIter<T>); impl<T> Iterator for IntoIter<T> { type Item = T; @@ -69,7 +71,7 @@ impl<T> IntoIterator for ExhaustiveSearch<T> { /// An iterator over the values in an exhaustive index. #[derive(Debug)] -pub struct Iter<'a, T>(std::slice::Iter<'a, T>); +pub struct Iter<'a, T>(core::slice::Iter<'a, T>); impl<'a, T> Iterator for Iter<'a, T> { type Item = &'a T; |