From 95c8031f3d2800ade28b593c17c138c6d389b1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Tue, 17 Mar 2020 00:51:01 +0100 Subject: [PATCH] Reuse `with_children` to remove some duplication --- native/src/widget/column.rs | 11 +---------- native/src/widget/row.rs | 11 +---------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/native/src/widget/column.rs b/native/src/widget/column.rs index b38b1ef1..a7a6f242 100644 --- a/native/src/widget/column.rs +++ b/native/src/widget/column.rs @@ -30,16 +30,7 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> { /// /// [`Column`]: struct.Column.html pub fn new() -> Self { - Column { - spacing: 0, - padding: 0, - width: Length::Shrink, - height: Length::Shrink, - max_width: u32::MAX, - max_height: u32::MAX, - align_items: Align::Start, - children: Vec::new(), - } + Self::with_children(Vec::new()) } /// Creates a [`Column`] with the given elements. diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs index b71d6480..c8812ea2 100644 --- a/native/src/widget/row.rs +++ b/native/src/widget/row.rs @@ -30,16 +30,7 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> { /// /// [`Row`]: struct.Row.html pub fn new() -> Self { - Row { - spacing: 0, - padding: 0, - width: Length::Shrink, - height: Length::Shrink, - max_width: u32::MAX, - max_height: u32::MAX, - align_items: Align::Start, - children: Vec::new(), - } + Self::with_children(Vec::new()) } /// Creates a [`Row`] with the given elements.