From ac181183cce7d7cbe50fd923ad04a0811e6fe042 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 20 Oct 2023 11:46:29 +0200 Subject: [PATCH] Checkpoint --- crates/gpui3/src/interactive.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/gpui3/src/interactive.rs b/crates/gpui3/src/interactive.rs index 4ad29f818f018bd13efe2b67d7a2107cac8b85ac..c0c787fe4992890f4555bf67720dbf2502c7f5b5 100644 --- a/crates/gpui3/src/interactive.rs +++ b/crates/gpui3/src/interactive.rs @@ -10,6 +10,7 @@ use refineable::Refineable; use smallvec::SmallVec; use std::{ any::{Any, TypeId}, + fmt::Debug, ops::Deref, sync::Arc, }; @@ -176,11 +177,14 @@ pub trait StatelessInteractive: Element { self } - fn context(mut self, context: impl Into) -> Self + fn context(mut self, context: C) -> Self where Self: Sized, + C: TryInto, + C::Error: Debug, { - self.stateless_interactivity().dispatch_context = context.into(); + self.stateless_interactivity().dispatch_context = + context.try_into().expect("invalid dispatch context"); self }