Skip to content

Commit 3b0d661

Browse files
committed
update deps
1 parent 7d7bbc3 commit 3b0d661

File tree

4 files changed

+19
-26
lines changed

4 files changed

+19
-26
lines changed

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Rust
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ "main" ]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [ "main" ]
88

99
env:
1010
CARGO_TERM_COLOR: always

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "spatialtree"
33
description = "A fast and flexible generic spatial tree collection (Octree, Quadtree, etc)"
4-
version = "0.1.2"
4+
version = "0.1.3"
55
edition = "2021"
66
license = "GPL-3.0"
77
repository = "https://github.com/alexpyattaev/spatialtree"
@@ -13,21 +13,21 @@ exclude = [".github/"]
1313

1414
[dependencies]
1515
arrayvec = "0.7"
16-
duplicate = "1.0"
16+
duplicate = "2.0"
1717
slab = "0.4"
18-
rand = { version = "0.8", features = ['small_rng'], optional = true }
18+
rand = { version = "0.9", features = ['small_rng'], optional = true }
1919

2020
[features]
2121
default = ["rand"]
2222
rand = ["dep:rand"]
2323

2424
[dev-dependencies]
2525
freelist = "0.1"
26-
lru = "0.10.0"
26+
lru = "0.13.0"
2727
rayon = "1.5"
2828
glium = "0.30"
2929
rand_derive = "0.5.0"
30-
criterion = { version = "0.4.0", features = ['html_reports'] }
30+
criterion = { version = "0.5.1", features = ['html_reports'] }
3131

3232
[[bench]]
3333
name = "iterators"

src/coords.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,13 @@ where
262262
// minimum corner of the bounding box
263263
let min = node.pos.iter().map(|e| {
264264
let x = e.tousize();
265-
(x << (level_difference + 1))
266-
.saturating_sub(bb_size - offset)
265+
(x << (level_difference + 1)).saturating_sub(bb_size - offset)
267266
});
268267

269268
// maximum corner of the bounding box
270269
let max = node.pos.iter().map(|e| {
271270
let x = e.tousize();
272-
(x << (level_difference + 1))
273-
.saturating_add(bb_size + offset)
271+
(x << (level_difference + 1)).saturating_add(bb_size + offset)
274272
});
275273

276274
// iterator over bounding boxes
@@ -376,13 +374,13 @@ pub fn rand_cv<const N: usize, R: rand::Rng, T>(
376374
max: CoordVec<N, T>,
377375
) -> CoordVec<N, T>
378376
where
379-
T: ReasonableIntegerLike + rand::distributions::uniform::SampleUniform,
377+
T: ReasonableIntegerLike + rand::distr::uniform::SampleUniform,
380378
{
381379
debug_assert_eq!(min.depth, max.depth);
382380
let mut zz = [T::fromusize(0); N];
383381
#[allow(clippy::needless_range_loop)]
384382
for i in 0..N {
385-
zz[i] = rng.gen_range(min.pos[i]..max.pos[i]);
383+
zz[i] = rng.random_range(min.pos[i]..max.pos[i]);
386384
}
387385
CoordVec::new(zz, min.depth)
388386
}

src/iter.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ where
107107
pos: L::root(),
108108
});
109109

110-
111110
ChunkIdxInAABBIter {
112111
to_visit,
113112
to_return: arrayvec::ArrayVec::new(),
@@ -116,7 +115,7 @@ where
116115
bound_min,
117116
bound_max,
118117
#[cfg(test)]
119-
max_stack:1
118+
max_stack: 1,
120119
}
121120
}
122121
#[inline]
@@ -125,7 +124,7 @@ where
125124
}
126125
}
127126

128-
impl<'a, const N: usize, const B: usize, L> Iterator for ChunkIdxInAABBIter<'a, N, B, L>
127+
impl<const N: usize, const B: usize, L> Iterator for ChunkIdxInAABBIter<'_, N, B, L>
129128
where
130129
L: LodVec<N>,
131130
{
@@ -250,8 +249,6 @@ pub fn iter_all_positions_in_bounds<const N: usize, L: LodVec<N>>(
250249
ite
251250
}
252251

253-
254-
255252
impl<'a, const N: usize, const B: usize, C, L> Tree<N, B, C, L>
256253
where
257254
C: Sized,
@@ -264,7 +261,7 @@ where
264261
&'a self,
265262
bound_min: L,
266263
bound_max: L,
267-
) -> ChunkIdxInAABBIter<N, B, L> {
264+
) -> ChunkIdxInAABBIter<'a, N, B, L> {
268265
ChunkIdxInAABBIter::new(&self.nodes, bound_min, bound_max)
269266
}
270267

@@ -274,10 +271,10 @@ where
274271
&'a self,
275272
bound_min: L,
276273
bound_max: L,
277-
) -> ChunksInAABBIter<N, B, C, L> {
274+
) -> ChunksInAABBIter<'a, N, B, C, L> {
278275
ChunksInAABBIter {
279276
chunks: &self.chunks,
280-
chunk_idx_iter: ChunkIdxInAABBIter::new(&self.nodes, bound_min, bound_max),
277+
chunk_idx_iter: ChunkIdxInAABBIter::new(&self.nodes, bound_min, bound_max),
281278
}
282279
}
283280
/// Iterate over mutable references to all chunks of the tree in the bounding box. Also returns chunk positions.
@@ -286,7 +283,7 @@ where
286283
&'a mut self,
287284
bound_min: L,
288285
bound_max: L,
289-
) -> ChunksInAABBIterMut<N, B, C, L> {
286+
) -> ChunksInAABBIterMut<'a, N, B, C, L> {
290287
ChunksInAABBIterMut {
291288
chunks: &mut self.chunks,
292289
chunk_idx_iter: ChunkIdxInAABBIter::new(&self.nodes, bound_min, bound_max),
@@ -312,7 +309,7 @@ mod tests {
312309
let mut rng = SmallRng::seed_from_u64(42);
313310

314311
for _i in 0..NUM_QUERIES {
315-
let depth = rng.gen_range(4u8..8u8);
312+
let depth = rng.random_range(4u8..8u8);
316313
let cmax = 1 << depth;
317314
let min = rand_cv(
318315
&mut rng,
@@ -346,7 +343,7 @@ mod tests {
346343
let mut rng = SmallRng::seed_from_u64(42);
347344

348345
for _i in 0..NUM_QUERIES {
349-
let depth = rng.gen_range(4u8..8u8);
346+
let depth = rng.random_range(4u8..8u8);
350347
let cmax = 1 << depth;
351348
let min = rand_cv(
352349
&mut rng,
@@ -388,7 +385,6 @@ mod tests {
388385
let expected_maxstack = ChunkIdxInAABBIter::<3, 8, OctVec>::stack_size(min);
389386

390387
assert_eq!(ite.chunk_idx_iter.max_stack, expected_maxstack);
391-
392388
}
393389

394390
println!("Testing QuadTree");
@@ -407,7 +403,6 @@ mod tests {
407403

408404
assert_eq!(ite.chunk_idx_iter.max_stack, expected_maxstack);
409405
}
410-
411406
}
412407
#[test]
413408
fn iterate_over_chunks_in_aabb() {

0 commit comments

Comments
 (0)