diff --git a/crates/gpui/src/view.rs b/crates/gpui/src/view.rs index 86d6def7cc77c719d758c9e2eb2fadb73443f382..c6483ba6ae6f0938ff6aed9b20018b13f92a32a1 100644 --- a/crates/gpui/src/view.rs +++ b/crates/gpui/src/view.rs @@ -8,6 +8,7 @@ use anyhow::Result; use collections::FxHashSet; use refineable::Refineable; use std::mem; +use std::rc::Rc; use std::{any::TypeId, fmt, ops::Range}; struct AnyViewState { @@ -73,7 +74,7 @@ impl Element for Entity { pub struct AnyView { entity: AnyEntity, render: fn(&AnyView, &mut Window, &mut App) -> AnyElement, - cached_style: Option, + cached_style: Option>, } impl From> for AnyView { @@ -91,7 +92,7 @@ impl AnyView { /// When using this method, the view's previous layout and paint will be recycled from the previous frame if [Context::notify] has not been called since it was rendered. /// The one exception is when [Window::refresh] is called, in which case caching is ignored. pub fn cached(mut self, style: StyleRefinement) -> Self { - self.cached_style = Some(style); + self.cached_style = Some(style.into()); self }