Attempt to return impl Element from render. 3 errors.

This commit is contained in:
Nathan Sobo 2023-12-30 08:58:07 -07:00 committed by Piotr Osiewicz
parent 5f2bb82ef3
commit 51d1d92d66
86 changed files with 230 additions and 443 deletions

View file

@ -1,6 +1,6 @@
use editor::{scroll::autoscroll::Autoscroll, Anchor, Editor, ExcerptId};
use gpui::{
actions, canvas, div, rems, uniform_list, AnyElement, AppContext, AvailableSpace, Div,
actions, canvas, div, rems, uniform_list, AnyElement, AppContext, AvailableSpace, Div, Element,
EventEmitter, FocusHandle, FocusableView, Hsla, InteractiveElement, IntoElement, Model,
MouseButton, MouseDownEvent, MouseMoveEvent, ParentElement, Pixels, Render, Styled,
UniformListScrollHandle, View, ViewContext, VisualContext, WeakView, WindowContext,
@ -305,9 +305,7 @@ impl SyntaxTreeView {
}
impl Render for SyntaxTreeView {
type Element = Div;
fn render(&mut self, cx: &mut gpui::ViewContext<'_, Self>) -> Self::Element {
fn render(&mut self, cx: &mut gpui::ViewContext<'_, Self>) -> impl Element {
let settings = ThemeSettings::get_global(cx);
let line_height = cx
.text_style()
@ -507,9 +505,7 @@ fn format_node_range(node: Node) -> String {
}
impl Render for SyntaxTreeToolbarItemView {
type Element = PopoverMenu<ContextMenu>;
fn render(&mut self, cx: &mut ViewContext<'_, Self>) -> PopoverMenu<ContextMenu> {
fn render(&mut self, cx: &mut ViewContext<'_, Self>) -> impl Element {
self.render_menu(cx)
.unwrap_or_else(|| popover_menu("Empty Syntax Tree"))
}