Rename `Hooks` to `Hook`

Antonio Scandurra and Nathan Sobo created

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

gpui/src/elements.rs         | 4 ++--
gpui/src/elements/hook.rs    | 6 +++---
zed/src/workspace/sidebar.rs | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)

Detailed changes

gpui/src/elements.rs 🔗

@@ -5,7 +5,7 @@ mod container;
 mod empty;
 mod event_handler;
 mod flex;
-mod hooks;
+mod hook;
 mod label;
 mod line_box;
 mod list;
@@ -24,7 +24,7 @@ pub use container::*;
 pub use empty::*;
 pub use event_handler::*;
 pub use flex::*;
-pub use hooks::*;
+pub use hook::*;
 pub use label::*;
 pub use line_box::*;
 pub use list::*;

gpui/src/elements/hooks.rs → gpui/src/elements/hook.rs 🔗

@@ -5,12 +5,12 @@ use crate::{
     SizeConstraint,
 };
 
-pub struct Hooks {
+pub struct Hook {
     child: ElementBox,
     after_layout: Option<Box<dyn FnMut(Vector2F, &mut LayoutContext)>>,
 }
 
-impl Hooks {
+impl Hook {
     pub fn new(child: ElementBox) -> Self {
         Self {
             child,
@@ -27,7 +27,7 @@ impl Hooks {
     }
 }
 
-impl Element for Hooks {
+impl Element for Hook {
     type LayoutState = ();
     type PaintState = ();
 

zed/src/workspace/sidebar.rs 🔗

@@ -116,7 +116,7 @@ impl Sidebar {
             container.add_child(
                 Flexible::new(
                     1.,
-                    Hooks::new(
+                    Hook::new(
                         ConstrainedBox::new(ChildView::new(active_item.id()).boxed())
                             .with_max_width(*self.width.borrow())
                             .boxed(),