diff --git a/src/app/layout_manager.rs b/src/app/layout_manager.rs index 7656b2e3..fad7343e 100644 --- a/src/app/layout_manager.rs +++ b/src/app/layout_manager.rs @@ -224,9 +224,7 @@ impl WidgetLayoutNode { children .iter() .map(|child| { - FlexElement::with_no_flex(Self::make_element( - ctx, app_state, data, child, false, - )) + FlexElement::new(Self::make_element(ctx, app_state, data, child, false)) }) .collect(), )) @@ -254,7 +252,9 @@ impl WidgetLayoutNode { } } - fn wrap_element(element: Element, rule: &WidgetLayoutRule) -> FlexElement { + fn wrap_element( + element: Element, rule: &WidgetLayoutRule, + ) -> FlexElement { match rule { WidgetLayoutRule::Expand { ratio } => FlexElement::with_flex(element, *ratio), WidgetLayoutRule::Length { width, height } => { diff --git a/src/tuine/component/base/flex/flex_element.rs b/src/tuine/component/base/flex/flex_element.rs index 9171915d..9af743f2 100644 --- a/src/tuine/component/base/flex/flex_element.rs +++ b/src/tuine/component/base/flex/flex_element.rs @@ -14,21 +14,21 @@ pub struct FlexElement { impl FlexElement { /// Creates a new [`FlexElement`] with a flex of 1. - pub fn new>>(element: I) -> Self { + pub fn new>>(element: E) -> Self { Self { flex: 1, element: element.into(), } } - pub fn with_flex>>(element: I, flex: u16) -> Self { + pub fn with_flex>>(element: E, flex: u16) -> Self { Self { flex, element: element.into(), } } - pub fn with_no_flex>>(element: I) -> Self { + pub fn with_no_flex>>(element: E) -> Self { Self { flex: 0, element: element.into(),