Generalize Layer implementations

This commit is contained in:
Dirkjan Ochtman 2021-01-11 21:13:17 +01:00
parent 7bfca28d85
commit c1e5acf35c
1 changed files with 3 additions and 3 deletions

View File

@ -417,7 +417,7 @@ impl SearchPool {
}
}
impl Layer for Vec<ZeroNode> {
impl Layer for [ZeroNode] {
fn nearest_iter(&self, pid: PointId) -> NearestIter<'_> {
NearestIter {
nearest: &self[pid.0 as usize].nearest,
@ -425,7 +425,7 @@ impl Layer for Vec<ZeroNode> {
}
}
impl Layer for Vec<UpperNode> {
impl Layer for [UpperNode] {
fn nearest_iter(&self, pid: PointId) -> NearestIter<'_> {
NearestIter {
nearest: &self[pid.0 as usize].nearest,
@ -503,7 +503,7 @@ impl Search {
fn select_heuristic<P: Point>(
&mut self,
layer: &Vec<ZeroNode>,
layer: &[ZeroNode],
num: usize,
point: &P,
points: &[P],