From b4c25f17cd8d75f05123928e47f44dd56275749f Mon Sep 17 00:00:00 2001 From: IshitaTakeshi Date: Wed, 15 May 2024 18:02:22 +0900 Subject: Make this crate work with no-std --- src/exhaustive.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/exhaustive.rs') 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(Vec); @@ -48,7 +50,7 @@ impl FromIterator for ExhaustiveSearch { /// An iterator that moves values out of an exhaustive index. #[derive(Debug)] -pub struct IntoIter(std::vec::IntoIter); +pub struct IntoIter(alloc::vec::IntoIter); impl Iterator for IntoIter { type Item = T; @@ -69,7 +71,7 @@ impl IntoIterator for ExhaustiveSearch { /// 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; -- cgit v1.2.3