Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remove unnecessary `Element` impl for `RootElement`
Antonio Scandurra4c1cba6def2d
diff --git a/crates/gpui/src/elements.rs b/crates/gpui/src/elements.rsindex 09b9c405899..dbeb9c218a1 100644--- a/crates/gpui/src/elements.rs+++ b/crates/gpui/src/elements.rs@@ -45,7 +45,6 @@ use std::{mem,ops::{Deref, DerefMut, Range},};-use util::ResultExt;pub trait Element<V: View>: 'static {type LayoutState;@@ -717,63 +716,6 @@ impl<V: View> AnyRootElement for RootElement<V> {}}-impl<V: View, R: View> Element<V> for RootElement<R> {- type LayoutState = ();- type PaintState = ();-- fn layout(- &mut self,- constraint: SizeConstraint,- _view: &mut V,- cx: &mut ViewContext<V>,- ) -> (Vector2F, ()) {- let size = AnyRootElement::layout(self, constraint, cx)- .log_err()- .unwrap_or_else(|| Vector2F::zero());- (size, ())- }-- fn paint(- &mut self,- scene: &mut SceneBuilder,- bounds: RectF,- visible_bounds: RectF,- _layout: &mut Self::LayoutState,- _view: &mut V,- cx: &mut ViewContext<V>,- ) {- AnyRootElement::paint(self, scene, bounds.origin(), visible_bounds, cx).log_err();- }-- fn rect_for_text_range(- &self,- range_utf16: Range<usize>,- _bounds: RectF,- _visible_bounds: RectF,- _layout: &Self::LayoutState,- _paint: &Self::PaintState,- _view: &V,- cx: &ViewContext<V>,- ) -> Option<RectF> {- AnyRootElement::rect_for_text_range(self, range_utf16, cx)- .log_err()- .flatten()- }-- fn debug(- &self,- _bounds: RectF,- _layout: &Self::LayoutState,- _paint: &Self::PaintState,- _view: &V,- cx: &ViewContext<V>,- ) -> serde_json::Value {- AnyRootElement::debug(self, cx)- .log_err()- .unwrap_or_default()- }-}-pub trait ParentElement<'a, V: View>: Extend<AnyElement<V>> + Sized {fn add_children<E: Element<V>>(&mut self, children: impl IntoIterator<Item = E>) {self.extend(children.into_iter().map(|child| child.into_any()));