From 568fec0f5431ad47d65fb426cf5cda18555c29dd Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Tue, 26 Sep 2023 18:15:41 -0400 Subject: [PATCH] Add `Sized` bound to `StyleHelpers` (#3042) This PR adds a `Sized` bound to the `StyleHelpers` trait. All of the individual methods on this trait already had a `Self: Sized` bound, so moving it up to the trait level will make it so we don't have to repeat ourselves so much. There's an open question of whether we can hoist the `Sized` bound to `Styleable`, but it's possible there are cases where we'd want to have a `Styleable` trait object. Release Notes: - N/A --- crates/gpui2/src/style.rs | 147 ++++++++------------------------------ 1 file changed, 30 insertions(+), 117 deletions(-) diff --git a/crates/gpui2/src/style.rs b/crates/gpui2/src/style.rs index 3e4acd57e7..ecb9d79a6c 100644 --- a/crates/gpui2/src/style.rs +++ b/crates/gpui2/src/style.rs @@ -320,174 +320,114 @@ use crate as gpui2; // // Example: // // Sets the padding to 0.5rem, just like class="p-2" in Tailwind. -// fn p_2(mut self) -> Self where Self: Sized; -pub trait StyleHelpers: Styleable