From f0775aeebc3e97ef37d5392b0a660f6f7659af22 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 3 Sep 2021 17:55:39 +0200 Subject: [PATCH] Rename `Hooks` to `Hook` Co-Authored-By: Nathan Sobo --- gpui/src/elements.rs | 4 ++-- gpui/src/elements/{hooks.rs => hook.rs} | 6 +++--- zed/src/workspace/sidebar.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename gpui/src/elements/{hooks.rs => hook.rs} (96%) diff --git a/gpui/src/elements.rs b/gpui/src/elements.rs index 7acd5cadad127e7014ee93ec5c49a2cbe11b22e0..6d7429222c7c1bf74d259932cbc5b3b614892ce3 100644 --- a/gpui/src/elements.rs +++ b/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::*; diff --git a/gpui/src/elements/hooks.rs b/gpui/src/elements/hook.rs similarity index 96% rename from gpui/src/elements/hooks.rs rename to gpui/src/elements/hook.rs index 9337578297ca038321189e39aae1b0d1c5cf72d2..994d5fe281ca1dae5984dd8456ffa32ce5be97a1 100644 --- a/gpui/src/elements/hooks.rs +++ b/gpui/src/elements/hook.rs @@ -5,12 +5,12 @@ use crate::{ SizeConstraint, }; -pub struct Hooks { +pub struct Hook { child: ElementBox, after_layout: Option>, } -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 = (); diff --git a/zed/src/workspace/sidebar.rs b/zed/src/workspace/sidebar.rs index afe4b328f2cbd6d6b71b641bf0a81da34d6f7801..71946b50acf90de63f056083bc90f1d251c7a97e 100644 --- a/zed/src/workspace/sidebar.rs +++ b/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(),