Skip to content

Commit

Permalink
Merge pull request #2460 from Andrew-Schwartz/master
Browse files Browse the repository at this point in the history
Add FromIterator for Row and Column
  • Loading branch information
hecrj authored Jun 16, 2024
2 parents 64426b7 + 620c3d3 commit 964ae95
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions widget/src/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,19 @@ where
}
}

impl<'a, Message, Theme, Renderer: crate::core::Renderer>
FromIterator<Element<'a, Message, Theme, Renderer>>
for Column<'a, Message, Theme, Renderer>
{
fn from_iter<
T: IntoIterator<Item = Element<'a, Message, Theme, Renderer>>,
>(
iter: T,
) -> Self {
Self::with_children(iter)
}
}

impl<'a, Message, Theme, Renderer> Widget<Message, Theme, Renderer>
for Column<'a, Message, Theme, Renderer>
where
Expand Down
13 changes: 13 additions & 0 deletions widget/src/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ where
}
}

impl<'a, Message, Theme, Renderer: crate::core::Renderer>
FromIterator<Element<'a, Message, Theme, Renderer>>
for Row<'a, Message, Theme, Renderer>
{
fn from_iter<
T: IntoIterator<Item = Element<'a, Message, Theme, Renderer>>,
>(
iter: T,
) -> Self {
Self::with_children(iter)
}
}

impl<'a, Message, Theme, Renderer> Widget<Message, Theme, Renderer>
for Row<'a, Message, Theme, Renderer>
where
Expand Down

0 comments on commit 964ae95

Please sign in to comment.