diff --git a/server-cli/src/main.rs b/server-cli/src/main.rs index 43d3916c52..0d36d8259f 100644 --- a/server-cli/src/main.rs +++ b/server-cli/src/main.rs @@ -168,10 +168,10 @@ fn main() -> io::Result<()> { let (server_tx, server_rx) = mpsc::channel::(); let mut region_manager = RegionManager::new(region_manager_tx, server_rx); - let mut job_manager: Arc = Arc::new(JobManager::new()); + let job_manager: Arc = Arc::new(JobManager::new()); let mut server = worldsim::server::Server::new(server_tx, region_manager_rx, job_manager.clone()); - let mut region = Region::new((0, 0), job_manager.clone()); + let _region = Region::new((0, 0), job_manager.clone()); job_manager.repeat(move || region_manager.work()); job_manager.repeat(move || server.work()); diff --git a/worldsim/src/lodstore/data.rs b/worldsim/src/lodstore/data.rs index 0113ec08e2..7c6d99d07f 100644 --- a/worldsim/src/lodstore/data.rs +++ b/worldsim/src/lodstore/data.rs @@ -1,12 +1,12 @@ -use super::index::ToOptionUsize; -use super::lodpos::LodPos; -use super::layer::{Layer, ParentLayer}; -#[allow(unused_imports)] //not unsued, cargo is just to stupud to detect that -use super::traversable::Traversable; -#[allow(unused_imports)] -use super::materializeable::Materializeable; #[allow(unused_imports)] use super::entrylayer::EntryLayer; +use super::index::ToOptionUsize; +use super::layer::{Layer, ParentLayer}; +use super::lodpos::LodPos; +#[allow(unused_imports)] +use super::materializeable::Materializeable; +#[allow(unused_imports)] //not unsued, cargo is just to stupud to detect that +use super::traversable::Traversable; use fxhash::FxHashMap; pub trait IndexStore: ParentLayer { @@ -48,26 +48,26 @@ pub struct HashNestLayer { } pub struct HashIter<'a, C: DetailStore> { - pub( super ) layer: &'a C, - pub( super ) wanted: LodPos, - pub( super ) layer_lod: LodPos, //LodPos aligned to layer::LEVEL + pub(super) layer: &'a C, + pub(super) wanted: LodPos, + pub(super) layer_lod: LodPos, //LodPos aligned to layer::LEVEL } pub struct HashIterMut<'a, C: DetailStore> { - pub( super ) layer: &'a mut C, - pub( super ) wanted: LodPos, - pub( super ) layer_lod: LodPos, //LodPos aligned to layer::LEVEL + pub(super) layer: &'a mut C, + pub(super) wanted: LodPos, + pub(super) layer_lod: LodPos, //LodPos aligned to layer::LEVEL } pub struct VecIter<'a, C: DetailStore> { - pub( super ) layer: &'a C, - pub( super ) wanted: LodPos, - pub( super ) layer_lod: LodPos, //LodPos aligned to layer::LEVEL - pub( super ) layer_key: usize, + pub(super) layer: &'a C, + pub(super) wanted: LodPos, + pub(super) layer_lod: LodPos, //LodPos aligned to layer::LEVEL + pub(super) layer_key: usize, } pub struct VecIterMut<'a, C: DetailStore> { - pub( super ) layer: &'a mut C, - pub( super ) wanted: LodPos, - pub( super ) layer_lod: LodPos, //LodPos aligned to layer::LEVEL - pub( super ) layer_key: usize, + pub(super) layer: &'a mut C, + pub(super) wanted: LodPos, + pub(super) layer_lod: LodPos, //LodPos aligned to layer::LEVEL + pub(super) layer_key: usize, } impl IndexStore for VecNestLayer { @@ -145,9 +145,9 @@ impl DetailStore for HashLayer { #[cfg(test)] pub mod tests { use crate::lodstore::data::*; - use test::Bencher; - use std::{u16, u32}; use crate::lodstore::traversable::Traversable; + use std::{u16, u32}; + use test::Bencher; #[rustfmt::skip] pub type ExampleData = @@ -257,8 +257,15 @@ pub mod tests { let mut x = gen_simple_example(); assert_eq!(*x.trav(LodPos::xyz(0, 0, 0)).get().get().get().mat(), 7_i8); assert_eq!(*x.trav(LodPos::xyz(0, 0, 1)).get().get().get().mat(), 6_i8); - x.trav_mut(LodPos::xyz(0, 0, 0)).get().get().get().store(123); - assert_eq!(*x.trav(LodPos::xyz(0, 0, 0)).get().get().get().mat(), 123_i8); + x.trav_mut(LodPos::xyz(0, 0, 0)) + .get() + .get() + .get() + .store(123); + assert_eq!( + *x.trav(LodPos::xyz(0, 0, 0)).get().get().get().mat(), + 123_i8 + ); } #[test] @@ -266,8 +273,15 @@ pub mod tests { let mut x = gen_simple_example(); assert_eq!(*x.trav(LodPos::xyz(0, 0, 0)).get().get().get().mat(), 7_i8); let c = *x.trav(LodPos::xyz(0, 0, 0)).get().get().get().mat(); - x.trav_mut(LodPos::xyz(0, 0, 0)).get().get().get().store(111 + c); - assert_eq!(*x.trav(LodPos::xyz(0, 0, 0)).get().get().get().mat(), 118_i8); + x.trav_mut(LodPos::xyz(0, 0, 0)) + .get() + .get() + .get() + .store(111 + c); + assert_eq!( + *x.trav(LodPos::xyz(0, 0, 0)).get().get().get().mat(), + 118_i8 + ); } /* allow this once we guarante get to be consistent even on Hash Lookups! @@ -313,28 +327,4 @@ pub mod tests { } b.iter(|| x.trav(access).get().get().get().mat()); } - -/* - pub struct MyIterMut<'a, C> { - pub( super ) layer: &'a mut C, - } - #[derive(Default, Clone)] - pub struct Layer { - pub child: C, - } - pub trait EntryPoint { - type TRAV_MUT<'a>; - fn trav_mut<'a>(&'a mut self, pos: LodPos) -> Self::TRAV_MUT; - } - impl EntryPoint - for Layer - { - type TRAV_MUT<'a> = MyIterMut<'a, Layer>; - - fn trav_mut<'a>(&'a mut self, pos: u8) -> Self::TRAV_MUT { - MyIterMut { - layer: self, - } - } - }*/ } diff --git a/worldsim/src/lodstore/delta.rs b/worldsim/src/lodstore/delta.rs index 97bdbacbf7..4fc8f048bc 100644 --- a/worldsim/src/lodstore/delta.rs +++ b/worldsim/src/lodstore/delta.rs @@ -1,12 +1,12 @@ -use super::data::{DetailStore}; -use super::lodpos::LodPos; -use super::layer::{Layer}; +use super::data::DetailStore; #[allow(unused_imports)] //not unsued, cargo is just to stupud to detect that use super::entrylayer::EntryLayer; -#[allow(unused_imports)] -use super::traversable::Traversable; +use super::layer::Layer; +use super::lodpos::LodPos; #[allow(unused_imports)] use super::materializeable::Materializeable; +#[allow(unused_imports)] +use super::traversable::Traversable; /* A LodDelta applies a change to a Lod The rules for LodDeltas are strict in order to make them as simple as possible. @@ -39,16 +39,16 @@ pub struct DeltaWriter<'a, C: DetailStore, D: DeltaStore> { } pub struct VecDeltaIter<'a, D: DeltaStore> { - pub( super ) layer: &'a D, + pub(super) layer: &'a D, } pub struct VecDeltaIterMut<'a, D: DeltaStore> { - pub( super ) layer: &'a mut D, + pub(super) layer: &'a mut D, } pub struct DataWriterIter { - pub( super ) delta_iter: DT, - pub( super ) data_iter: CT, + pub(super) delta_iter: DT, + pub(super) data_iter: CT, } //####################################################### @@ -124,26 +124,20 @@ mod stests { let mut x = gen_simple_example(); let mut d = ExampleDelta::default(); //assert_eq!(x.detail_index.len(),1); - assert_eq!(d.detail.len(),0); - assert_eq!(d.child.detail.len(),0); - assert_eq!(d.child.child.detail.len(),0); - assert_eq!(d.child.child.child.detail.len(),0); + assert_eq!(d.detail.len(), 0); + assert_eq!(d.child.detail.len(), 0); + assert_eq!(d.child.child.detail.len(), 0); + assert_eq!(d.child.child.child.detail.len(), 0); let i = LodPos::xyz(0, 0, 0); { let mut w = DeltaWriter::new(&mut d, &mut x); assert_eq!(*w.trav_mut(i).get().get().get().mat(), 7_i8); - } - { - let mut w = DeltaWriter::new(&mut d, &mut x); w.trav_mut(i).get().get().get().store(123); - } - { //TODO: this shouldnt be necessary but somehow it is... - let mut w = DeltaWriter::new(&mut d, &mut x); assert_eq!(*w.trav_mut(i).get().get().get().mat(), 123_i8); - assert_eq!(d.detail.len(),0); - assert_eq!(d.child.detail.len(),0); - assert_eq!(d.child.child.detail.len(),0); - assert_eq!(d.child.child.child.detail.len(),1); + assert_eq!(d.detail.len(), 0); + assert_eq!(d.child.detail.len(), 0); + assert_eq!(d.child.child.detail.len(), 0); + assert_eq!(d.child.child.child.detail.len(), 1); //assert_eq!(x.detail_index.len(),1); } } @@ -156,28 +150,25 @@ mod stests { { let mut w = DeltaWriter::new(&mut d, &mut x); assert_eq!(*w.trav_mut(i).get().get().get().mat(), 7_i8); - } - { - let mut w = DeltaWriter::new(&mut d, &mut x); w.trav_mut(i).get().get().get().store(123); - } - { - let mut w = DeltaWriter::new(&mut d, &mut x); - w.trav_mut(LodPos::xyz(0, 0, 1)).get().get().get().store(111); - } - { - let mut w = DeltaWriter::new(&mut d, &mut x); - w.trav_mut(LodPos::xyz(0, 0, 2)).get().get().get().store(112); - } - { - let mut w = DeltaWriter::new(&mut d, &mut x); - w.trav_mut(LodPos::xyz(0, 0, 3)).get().get().get().store(111); - } - { //TODO: this shouldnt be necessary but somehow it is... - let mut w = DeltaWriter::new(&mut d, &mut x); + w.trav_mut(LodPos::xyz(0, 0, 1)) + .get() + .get() + .get() + .store(111); + w.trav_mut(LodPos::xyz(0, 0, 2)) + .get() + .get() + .get() + .store(112); + w.trav_mut(LodPos::xyz(0, 0, 3)) + .get() + .get() + .get() + .store(111); let i = LodPos::xyz(0, 0, 0); assert_eq!(*w.trav_mut(i).get().get().get().mat(), 123_i8); - assert_eq!(x.detail_index.len(),1); + assert_eq!(x.detail_index.len(), 1); } } @@ -187,7 +178,9 @@ mod stests { let mut d = ExampleDelta::default(); { let mut w = DeltaWriter::new(&mut d, &mut x); - b.iter(|| {w.trav_mut(LodPos::xyz(0, 0, 0));}); + b.iter(|| { + w.trav_mut(LodPos::xyz(0, 0, 0)); + }); } } @@ -197,7 +190,9 @@ mod stests { let mut d = ExampleDelta::default(); { let mut w = DeltaWriter::new(&mut d, &mut x); - b.iter(|| {w.trav_mut(LodPos::xyz(0, 0, 0)).get().get().get().mat();}); + b.iter(|| { + w.trav_mut(LodPos::xyz(0, 0, 0)).get().get().get().mat(); + }); } } @@ -207,14 +202,11 @@ mod stests { let mut d = ExampleDelta::default(); { let mut w = DeltaWriter::new(&mut d, &mut x); - //b.iter(|| w.trav_mut(LodPos::xyz(0, 0, 0)).get().get().get()); - w.trav_mut(LodPos::xyz(0, 0, 0)); - w.trav_mut(LodPos::xyz(0, 0, 0)); + b.iter(|| { + w.trav_mut(LodPos::xyz(0, 0, 0)).get().get().get(); + }); } } - fn ddd<'a,'b:'a, D>() { - - } #[bench] fn bench_trav(b: &mut Bencher) { @@ -222,50 +214,9 @@ mod stests { let mut d = ExampleDelta::default(); { let mut w = DeltaWriter::new(&mut d, &mut x); - b.iter(|| {w.trav_mut(LodPos::xyz(0, 0, 0));}); + b.iter(|| { + w.trav_mut(LodPos::xyz(0, 0, 0)); + }); } } -/* - pub struct ThisWorks<'a> { - pub ddd: &'a mut u64, - } - - impl<'a> ThisWorks<'a> { - fn reff<'b>(&'b mut self) -> &'b mut u64 { - self.ddd - } - } - - pub struct ThisDoestn<'a> { - pub ddd: &'a mut u64, - } - - impl<'a> ThisDoestn<'a> { - fn reff<'b>(&'b mut self) -> &'a mut u64 where 'a: 'b { - self.ddd - } - } - - pub struct ThisDoestnNeither<'a> { - pub ddd: &'a mut u64, - } - - impl<'a> ThisDoestnNeither<'a> { - fn reff<'b: 'a>(&'b mut self) -> &'a mut u64 { - self.ddd - } - } - - #[bench] - fn bench_travss(b: &mut Bencher) { - let mut u: u64 = 1; - let mut d = ThisWorks{ddd: &mut u}; - { - b.iter(|| *d.ddd = *d.ddd + 1_u64); - b.iter(|| {d.reff();}); - d.reff(); - d.reff(); - } - } -*/ -} \ No newline at end of file +} diff --git a/worldsim/src/lodstore/deltalizeable.rs b/worldsim/src/lodstore/deltalizeable.rs index 7457b0dea8..c3af64a680 100644 --- a/worldsim/src/lodstore/deltalizeable.rs +++ b/worldsim/src/lodstore/deltalizeable.rs @@ -1,5 +1,5 @@ -use super::lodpos::{LodPos}; use super::delta::{DeltaStore, VecDeltaIterMut}; +use super::lodpos::LodPos; pub trait Deltalizeable { type DELTA: DeltaStore; @@ -13,4 +13,4 @@ impl<'a, D: DeltaStore> Deltalizeable for VecDeltaIterMut<'a, D> { fn store(self, pos: LodPos, value: Option) { self.layer.store(pos, value); } -} \ No newline at end of file +} diff --git a/worldsim/src/lodstore/entrylayer.rs b/worldsim/src/lodstore/entrylayer.rs index 626a6ca708..dc7efdefd2 100644 --- a/worldsim/src/lodstore/entrylayer.rs +++ b/worldsim/src/lodstore/entrylayer.rs @@ -1,7 +1,9 @@ +use super::data::{DetailStore, HashIter, HashIterMut, HashNestLayer}; +use super::delta::{ + DataWriterIter, DeltaStore, DeltaWriter, VecDeltaIter, VecDeltaIterMut, VecNestDelta, +}; use super::index::ToOptionUsize; use super::lodpos::LodPos; -use super::data::{HashNestLayer, DetailStore, HashIter, HashIterMut}; -use super::delta::{VecNestDelta, DeltaStore, VecDeltaIter, VecDeltaIterMut, DataWriterIter, DeltaWriter}; use super::traversable::Traversable; //TODO: actually implement EntryLayer @@ -13,8 +15,7 @@ pub trait EntryLayer { } ///////////////// data types -impl HashNestLayer -{ +impl HashNestLayer { pub fn trav<'a>(&'a self, pos: LodPos) -> HashIter<'a, HashNestLayer> { HashIter { layer: self, @@ -23,7 +24,10 @@ impl HashNestLayer(&'a mut self, pos: LodPos) -> HashIterMut<'a, HashNestLayer> { + pub fn trav_mut<'a>( + &'a mut self, + pos: LodPos, + ) -> HashIterMut<'a, HashNestLayer> { HashIterMut { layer: self, wanted: pos, @@ -37,24 +41,40 @@ impl VecNestDelta { pub fn trav<'a>(&'a self, _pos: LodPos) -> VecDeltaIter<'a, VecNestDelta> { VecDeltaIter { layer: self } } - pub fn trav_mut<'a>(&'a mut self, _pos: LodPos) -> VecDeltaIterMut<'a, VecNestDelta> { + pub fn trav_mut<'a>( + &'a mut self, + _pos: LodPos, + ) -> VecDeltaIterMut<'a, VecNestDelta> { VecDeltaIterMut { layer: self } } } -impl DeltaWriter<'_, HashNestLayer, VecNestDelta> +impl + DeltaWriter<'_, HashNestLayer, VecNestDelta> { - pub fn trav<'a>(&'a self, pos: LodPos) -> DataWriterIter>, HashIter<'a, HashNestLayer>> { + pub fn trav<'a>( + &'a self, + pos: LodPos, + ) -> DataWriterIter< + VecDeltaIter<'a, VecNestDelta>, + HashIter<'a, HashNestLayer>, + > { DataWriterIter { delta_iter: self.delta.trav(pos), data_iter: self.data.trav(pos), } } - pub fn trav_mut<'a>(&'a mut self, pos: LodPos) -> DataWriterIter< VecDeltaIterMut<'a, VecNestDelta>, HashIterMut<'a, HashNestLayer>> { + pub fn trav_mut<'a>( + &'a mut self, + pos: LodPos, + ) -> DataWriterIter< + VecDeltaIterMut<'a, VecNestDelta>, + HashIterMut<'a, HashNestLayer>, + > { DataWriterIter { delta_iter: self.delta.trav_mut(pos), data_iter: self.data.trav_mut(pos), } } -} \ No newline at end of file +} diff --git a/worldsim/src/lodstore/layer.rs b/worldsim/src/lodstore/layer.rs index e8737acc62..7368d0b4b3 100644 --- a/worldsim/src/lodstore/layer.rs +++ b/worldsim/src/lodstore/layer.rs @@ -1,7 +1,7 @@ +use super::data::{DetailStore, HashLayer, HashNestLayer, VecLayer, VecNestLayer}; +use super::delta::{DeltaStore, VecDelta, VecNestDelta}; use super::index::ToOptionUsize; use super::lodpos::{two_pow_u, LodPos}; -use super::data::{VecLayer, HashLayer, VecNestLayer, HashNestLayer, DetailStore}; -use super::delta::{VecDelta, VecNestDelta, DeltaStore}; use vek::Vec3; pub trait Layer { @@ -83,4 +83,4 @@ impl ParentLayer for VecNestDelta { fn child_mut(&mut self) -> &mut Self::CHILD { &mut self.child } -} \ No newline at end of file +} diff --git a/worldsim/src/lodstore/materializeable.rs b/worldsim/src/lodstore/materializeable.rs index 135f8e15a0..9a0372ceee 100644 --- a/worldsim/src/lodstore/materializeable.rs +++ b/worldsim/src/lodstore/materializeable.rs @@ -1,7 +1,7 @@ -use super::lodpos::{LodPos}; -use super::data::{DetailStore, HashIter, VecIter, HashIterMut, VecIterMut}; -use super::delta::{DataWriterIter}; -use super::deltalizeable::{Deltalizeable}; +use super::data::{DetailStore, HashIter, HashIterMut, VecIter, VecIterMut}; +use super::delta::DataWriterIter; +use super::deltalizeable::Deltalizeable; +use super::lodpos::LodPos; /* @@ -28,15 +28,15 @@ pub trait Materializeable<'a> { ///////////////// data types impl<'a, L: DetailStore> Materializeable<'a> for HashIter<'a, L> { -type MAT_CHILD = L::DETAIL; + type MAT_CHILD = L::DETAIL; -fn mat(self) -> &'a L::DETAIL { -DetailStore::load(self.layer, self.layer_lod) -} -fn store(self, _mat: L::DETAIL) { - unimplemented!("only call on mut Iter"); -//DetailStore::save(self.layer, self.layer_key, mat) -} + fn mat(self) -> &'a L::DETAIL { + DetailStore::load(self.layer, self.layer_lod) + } + fn store(self, _mat: L::DETAIL) { + unimplemented!("only call on mut Iter"); + //DetailStore::save(self.layer, self.layer_key, mat) + } } impl<'a, L: DetailStore> Materializeable<'a> for HashIterMut<'a, L> { @@ -51,19 +51,23 @@ impl<'a, L: DetailStore> Materializeable<'a> for HashIterMut<'a, L } impl<'a, L: DetailStore> Materializeable<'a> for VecIter<'a, L> { -type MAT_CHILD = L::DETAIL; + type MAT_CHILD = L::DETAIL; -fn mat(self) -> &'a L::DETAIL { DetailStore::load(self.layer, self.layer_key) } -fn store(self, _mat: L::DETAIL) { - unimplemented!("only call on mut Iter"); -//DetailStore::save(self.layer, self.layer_key, mat) -} + fn mat(self) -> &'a L::DETAIL { + DetailStore::load(self.layer, self.layer_key) + } + fn store(self, _mat: L::DETAIL) { + unimplemented!("only call on mut Iter"); + //DetailStore::save(self.layer, self.layer_key, mat) + } } impl<'a, L: DetailStore> Materializeable<'a> for VecIterMut<'a, L> { type MAT_CHILD = L::DETAIL; - fn mat(self) -> &'a L::DETAIL { DetailStore::load(self.layer, self.layer_key) } + fn mat(self) -> &'a L::DETAIL { + DetailStore::load(self.layer, self.layer_key) + } fn store(self, mat: L::DETAIL) { DetailStore::save(self.layer, self.layer_key, mat) } @@ -71,19 +75,21 @@ impl<'a, L: DetailStore> Materializeable<'a> for VecIterMut<'a, L> ///////////////// delta types -impl<'a, DT: Deltalizeable, CT: Materializeable<'a>> Materializeable<'a> for DataWriterIter { -type MAT_CHILD = CT::MAT_CHILD; +impl<'a, DT: Deltalizeable, CT: Materializeable<'a>> Materializeable<'a> + for DataWriterIter +{ + type MAT_CHILD = CT::MAT_CHILD; -fn mat(self) -> &'a CT::MAT_CHILD { -self.data_iter.mat() -} -fn store(self, mat: CT::MAT_CHILD) { - //self.delta_iter.register(LodPos::xyz(2,2,2,), mat); + fn mat(self) -> &'a CT::MAT_CHILD { + self.data_iter.mat() + } + fn store(self, mat: CT::MAT_CHILD) { + //self.delta_iter.register(LodPos::xyz(2,2,2,), mat); - //
::DELTA::store(self.delta_iter,LodPos::xyz(2,2,2), None); - self.delta_iter.store(LodPos::xyz(2,2,2), None); - println!("saaave"); - self.data_iter.store(mat); -//self.data_iter.store(mat) -} + //
::DELTA::store(self.delta_iter,LodPos::xyz(2,2,2), None); + self.delta_iter.store(LodPos::xyz(2, 2, 2), None); + println!("saaave"); + self.data_iter.store(mat); + //self.data_iter.store(mat) + } } diff --git a/worldsim/src/lodstore/mod.rs b/worldsim/src/lodstore/mod.rs index a71945e326..6a941af1ab 100644 --- a/worldsim/src/lodstore/mod.rs +++ b/worldsim/src/lodstore/mod.rs @@ -1,14 +1,14 @@ -pub mod lodpos; -pub mod lodarea; -pub mod layer; -pub mod traversable; -pub mod materializeable; -pub mod deltalizeable; -pub mod entrylayer; pub mod data; pub mod delta; +pub mod deltalizeable; pub mod drill; +pub mod entrylayer; pub mod index; +pub mod layer; +pub mod lodarea; +pub mod lodpos; +pub mod materializeable; +pub mod traversable; pub use data::{HashLayer, HashNestLayer, VecLayer, VecNestLayer}; /* diff --git a/worldsim/src/lodstore/traversable.rs b/worldsim/src/lodstore/traversable.rs index 55b9bcfa83..0fb6fd0078 100644 --- a/worldsim/src/lodstore/traversable.rs +++ b/worldsim/src/lodstore/traversable.rs @@ -1,9 +1,9 @@ +use super::data::{DetailStore, HashIter, HashIterMut, IndexStore, VecIter, VecIterMut}; +use super::delta::{DataWriterIter, DeltaStore, VecDeltaIter, VecDeltaIterMut}; use super::index::ToOptionUsize; -use super::lodpos::{multily_with_2_pow_n, relative_to_1d, LodPos}; -use super::data::{DetailStore, IndexStore, HashIter, VecIter, HashIterMut, VecIterMut}; -use super::delta::{DeltaStore, VecDeltaIter, VecDeltaIterMut, DataWriterIter}; #[allow(unused_imports)] //not unsued, cargo is just to stupud to detect that use super::layer::{Layer, ParentLayer}; +use super::lodpos::{multily_with_2_pow_n, relative_to_1d, LodPos}; pub trait Traversable { type TRAV_CHILD; @@ -13,8 +13,8 @@ pub trait Traversable { ///////////////// data types impl<'a, L: DetailStore + IndexStore> Traversable for HashIter<'a, L> - where - L::CHILD: DetailStore, +where + L::CHILD: DetailStore, { type TRAV_CHILD = VecIter<'a, L::CHILD>; @@ -40,8 +40,8 @@ impl<'a, L: DetailStore + IndexStore> Traversable for HashIter<'a, } impl<'a, L: DetailStore + IndexStore> Traversable for HashIterMut<'a, L> - where - L::CHILD: DetailStore, +where + L::CHILD: DetailStore, { type TRAV_CHILD = VecIterMut<'a, L::CHILD>; @@ -67,8 +67,8 @@ impl<'a, L: DetailStore + IndexStore> Traversable for HashIterMut< } impl<'a, L: DetailStore + IndexStore> Traversable for VecIter<'a, L> - where - L::CHILD: DetailStore, +where + L::CHILD: DetailStore, { type TRAV_CHILD = VecIter<'a, L::CHILD>; @@ -94,8 +94,8 @@ impl<'a, L: DetailStore + IndexStore> Traversable for VecIter<'a, L } impl<'a, L: DetailStore + IndexStore> Traversable for VecIterMut<'a, L> - where - L::CHILD: DetailStore, +where + L::CHILD: DetailStore, { type TRAV_CHILD = VecIterMut<'a, L::CHILD>; @@ -123,8 +123,8 @@ impl<'a, L: DetailStore + IndexStore> Traversable for VecIterMut<'a ///////////////// delta types impl<'a, D: DeltaStore + ParentLayer> Traversable for VecDeltaIter<'a, D> - where - D::CHILD: DeltaStore, +where + D::CHILD: DeltaStore, { type TRAV_CHILD = VecDeltaIter<'a, D::CHILD>; @@ -136,8 +136,8 @@ impl<'a, D: DeltaStore + ParentLayer> Traversable for VecDeltaIter<'a, D> } impl<'a, D: DeltaStore + ParentLayer> Traversable for VecDeltaIterMut<'a, D> - where - D::CHILD: DeltaStore, +where + D::CHILD: DeltaStore, { type TRAV_CHILD = VecDeltaIterMut<'a, D::CHILD>; @@ -157,4 +157,4 @@ impl Traversable for DataWriterIter { data_iter: self.data_iter.get(), } } -} \ No newline at end of file +}