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/vp.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/vp.rs') diff --git a/src/vp.rs b/src/vp.rs index a761cbf..9612bc2 100644 --- a/src/vp.rs +++ b/src/vp.rs @@ -4,9 +4,12 @@ use crate::distance::{Distance, DistanceValue, Metric, Proximity}; use crate::knn::{ExactNeighbors, NearestNeighbors, Neighborhood}; use crate::util::Ordered; +use alloc::boxed::Box; +use alloc::vec::Vec; + use num_traits::zero; -use std::fmt::{self, Debug, Formatter}; +use core::fmt::{self, Debug, Formatter}; /// A node in a VP tree. #[derive(Debug)] @@ -527,7 +530,7 @@ impl FromIterator for FlatVpTree { } /// An iterator that moves values out of a flat VP tree. -pub struct FlatIntoIter(std::vec::IntoIter>); +pub struct FlatIntoIter(alloc::vec::IntoIter>); impl Debug for FlatIntoIter where @@ -559,7 +562,7 @@ impl IntoIterator for FlatVpTree { } /// An iterator over the values in a flat VP tree. -pub struct FlatIter<'a, T: Proximity>(std::slice::Iter<'a, FlatVpNode>); +pub struct FlatIter<'a, T: Proximity>(core::slice::Iter<'a, FlatVpNode>); impl<'a, T> Debug for FlatIter<'a, T> where -- cgit v1.2.3