Remove `shape::Update`

It is no longer being used.
This commit is contained in:
Hanno Braun 2022-06-28 17:16:53 +02:00
parent 9cded04202
commit 496a693f86
3 changed files with 0 additions and 27 deletions

View File

@ -6,12 +6,10 @@ mod api;
mod local;
mod object;
mod stores;
mod update;
pub use self::{
api::Shape,
local::LocalForm,
object::Object,
stores::{Handle, Iter},
update::Update,
};

View File

@ -81,15 +81,6 @@ impl<T: Object> Store<T> {
}
}
pub fn update<F>(&mut self, mut f: F)
where
F: FnMut(&mut T),
{
for (_, object) in self.objects.write().iter_mut() {
f(object);
}
}
fn ptr(&self) -> *const () {
Arc::as_ptr(&self.objects) as _
}

View File

@ -1,16 +0,0 @@
use super::{stores::Stores, Object};
/// API to update a `Shape`
///
/// See [`Shape::update`].
pub struct Update<'r> {
stores: &'r mut Stores,
}
impl<'r> Update<'r> {
/// Update all objects of a specific type
pub fn update_all<T: Object>(self, f: impl FnMut(&mut T)) -> Self {
self.stores.get::<T>().update(f);
self
}
}