Remove UpdateModel trait

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-04-24 16:52:09 +02:00
parent a9417f3d2e
commit a6115d9330
3 changed files with 33 additions and 101 deletions

View file

@ -23,8 +23,8 @@ use crate::{
platform,
platform::{Event, InputHandler, KeyDownEvent, Platform},
Action, AnyViewHandle, AppContext, BorrowAppContext, Entity, FontCache, Handle, ModelContext,
ModelHandle, ReadViewWith, Subscription, Task, UpdateModel, UpdateView, View, ViewContext,
ViewHandle, WeakHandle, WindowContext,
ModelHandle, ReadViewWith, Subscription, Task, UpdateView, View, ViewContext, ViewHandle,
WeakHandle, WindowContext,
};
use collections::BTreeMap;
@ -391,16 +391,6 @@ impl BorrowAppContext for TestAppContext {
}
}
impl UpdateModel for TestAppContext {
fn update_model<T: Entity, O>(
&mut self,
handle: &ModelHandle<T>,
update: &mut dyn FnMut(&mut T, &mut ModelContext<T>) -> O,
) -> O {
self.cx.borrow_mut().update_model(handle, update)
}
}
impl UpdateView for TestAppContext {
type Output<S> = S;