WIP

Antonio Scandurra created

Change summary

crates/gpui2/src/view.rs      | 7 +++++++
crates/workspace2/src/item.rs | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)

Detailed changes

crates/gpui2/src/view.rs 🔗

@@ -57,6 +57,13 @@ impl<V: 'static> View<V> {
     {
         cx.update_view(self, f)
     }
+
+    pub fn read<C>(&self, cx: &mut C) -> &V
+    where
+        C: VisualContext,
+    {
+        todo!()
+    }
 }
 
 impl<V> Clone for View<V> {

crates/workspace2/src/item.rs 🔗

@@ -159,9 +159,9 @@ pub trait Item: EventEmitter + Sized {
     //     ) -> Task<Result<()>> {
     //         unimplemented!("reload() must be implemented if can_save() returns true")
     //     }
-    //     fn to_item_events(_event: &Self::Event) -> SmallVec<[ItemEvent; 2]> {
-    //         SmallVec::new()
-    //     }
+    fn to_item_events(_event: &Self::Event) -> SmallVec<[ItemEvent; 2]> {
+        SmallVec::new()
+    }
     //     fn should_close_item_on_event(_: &Self::Event) -> bool {
     //         false
     //     }