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