Rename IntoAnyElement trait to Component

This commit is contained in:
Nathan Sobo 2023-10-26 12:46:52 +02:00
parent 8ecfea55cd
commit 0285284ae1
60 changed files with 297 additions and 300 deletions

View file

@ -1,5 +1,5 @@
use gpui2::{
AnyElement, Bounds, Element, Hsla, IntoAnyElement, LayoutId, Pixels, Result, ViewContext,
AnyElement, Bounds, Component, Element, Hsla, LayoutId, Pixels, Result, ViewContext,
WindowContext,
};
use serde::{de::Visitor, Deserialize, Deserializer};
@ -149,13 +149,13 @@ pub struct Themed<E> {
pub(crate) child: E,
}
impl<V, E> IntoAnyElement<V> for Themed<E>
impl<V, E> Component<V> for Themed<E>
where
V: 'static,
E: 'static + Element<V> + Send + Sync,
E::ElementState: Send + Sync,
{
fn into_any(self) -> AnyElement<V> {
fn render(self) -> AnyElement<V> {
AnyElement::new(self)
}
}