Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

docs: Change `render` function's return type (#27229)

迷渡962709f42cf4
diff --git a/crates/gpui/docs/key_dispatch.md b/crates/gpui/docs/key_dispatch.md
index 5d3b1cac7e3..ae7d828a4a3 100644
--- a/crates/gpui/docs/key_dispatch.md
+++ b/crates/gpui/docs/key_dispatch.md
@@ -42,7 +42,7 @@ To bind actions, chain `on_action` on to your element:
```rust
impl Render for Menu {
- fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl Component {
+ fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
div()
.on_action(|this: &mut Menu, move: &MoveUp, window: &mut Window, cx: &mut Context<Menu>| {
// ...
@@ -59,7 +59,7 @@ In order to bind keys to actions, you need to declare a _key context_ for part o
```rust
impl Render for Menu {
- fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl Component {
+ fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
div()
.key_context("menu")
.on_action(|this: &mut Menu, move: &MoveUp, window: &mut Window, cx: &mut Context<Menu>| {