Skip to content

Commit bf5be5c

Browse files
committed
Update kd_tree.rs
1 parent 6bb1391 commit bf5be5c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/data_structures/kd_tree.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ mod test {
364364

365365
#[test]
366366
fn insert() {
367-
let points = (0..100)
367+
let points: Vec<[f64; 2]> = (0..100)
368368
.map(|_| {
369369
[
370370
(rand::random::<f64>() * 1000.0).round() / 10.0,
@@ -385,7 +385,7 @@ mod test {
385385

386386
#[test]
387387
fn contains() {
388-
let points = (0..100)
388+
let points: Vec<[f64; 2]> = (0..100)
389389
.map(|_| {
390390
[
391391
(rand::random::<f64>() * 1000.0).round() / 10.0,
@@ -405,7 +405,7 @@ mod test {
405405

406406
#[test]
407407
fn delete() {
408-
let points = (0..100)
408+
let points: Vec<[f64; 2]> = (0..100)
409409
.map(|_| {
410410
[
411411
(rand::random::<f64>() * 1000.0).round() / 10.0,
@@ -426,7 +426,7 @@ mod test {
426426
#[test]
427427
fn nearest_neighbors() {
428428
// Test with large data set
429-
let points_1 = (0..1000)
429+
let points_1: Vec<[f64; 2]> = (0..1000)
430430
.map(|_| {
431431
[
432432
(rand::random::<f64>() * 1000.0).round() / 10.0,
@@ -450,7 +450,7 @@ mod test {
450450
}
451451

452452
// Test with small data set
453-
let points_2 = vec![
453+
let points_2: Vec<[f64; 2]> = vec![
454454
[2.0, 3.0],
455455
[5.0, 4.0],
456456
[9.0, 6.0],
@@ -473,7 +473,7 @@ mod test {
473473

474474
#[test]
475475
fn is_empty() {
476-
let mut kd_tree = KDTree::new();
476+
let mut kd_tree: KDTree<f64, 2> = KDTree::new();
477477

478478
assert!(kd_tree.is_empty());
479479

@@ -484,7 +484,7 @@ mod test {
484484

485485
#[test]
486486
fn len() {
487-
let points = (0..1000)
487+
let points: Vec<[f64; 2]> = (0..1000)
488488
.map(|_| {
489489
[
490490
(rand::random::<f64>() * 1000.0).round() / 10.0,

0 commit comments

Comments
 (0)