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.

Update crates/ui/docs/hello-world.md TODO with explanation of SharedString usage (#10664)

Keith535bcfad1059
diff --git a/crates/ui/docs/hello-world.md b/crates/ui/docs/hello-world.md
index 12ee4d7abaa..a13331e11f7 100644
--- a/crates/ui/docs/hello-world.md
+++ b/crates/ui/docs/hello-world.md
@@ -40,7 +40,7 @@ impl<V: 'static> TodoList<V> {
All of this is relatively straightforward.
-We use [gpui::SharedString] in components instead of [std::string::String]. This allows us to [TODO: someone who actually knows please explain why we use SharedString].
+We use [gpui::SharedString] in components instead of [std::string::String]. This allows us to efficiently handle shared string data across multiple components and threads without the performance overhead of copying strings.
When we want to pass an action we pass a `ClickHandler`. Whenever we want to add an action, the struct it belongs to needs to be generic over the view type `V`.