This commit is contained in:
JMARyA 2025-01-16 23:31:51 +01:00
parent 8887eb07c1
commit 340f014365
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -68,19 +68,19 @@ impl DivWidget {
}
#[must_use]
pub fn push_for<
'a,
pub fn push_for_each<
T: UIWidget + 'static,
X: 'a,
X,
U: Fn(&X) -> T,
I: IntoIterator<Item = &'a X>,
I: Iterator<Item = X>,
O: Into<I>,
>(
mut self,
iterator: I,
iterator: O,
then: U,
) -> Self {
for val in iterator {
self.0.push(Box::new(then(val)));
for val in iterator.into() {
self.0.push(Box::new(then(&val)));
}
self
}