I was attempting to create a row of several text objects in a loop:
fn view(&self) -> Element<Message> {
let height = 7;
let mut col: Column<'_, Message> = column![];
for num in 0..height {
col.push(text!(""));
}
col.into()
}
However col
falls out of scope after the loop. This is because the column push function uses self
instead of &mut self
. Is this intentional behavior? Is there a better way to achieve this affect?