Reuse with_children to remove some duplication

This commit is contained in:
Héctor Ramón Jiménez 2020-03-17 00:51:01 +01:00
parent a146e53eb0
commit 95c8031f3d
2 changed files with 2 additions and 20 deletions

View File

@ -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.

View File

@ -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.