radicle-term: Optimize impl of VStack::children()
This way the Iterator::size_hint() function can be used by the Extend::extend() implementation, which might safe reallocations for the underlying buffer. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
93388e366c
commit
19c484e956
|
|
@ -77,10 +77,9 @@ impl<'a> VStack<'a> {
|
||||||
I: IntoIterator<Item = Box<dyn Element>>,
|
I: IntoIterator<Item = Box<dyn Element>>,
|
||||||
{
|
{
|
||||||
let mut vstack = self;
|
let mut vstack = self;
|
||||||
|
vstack
|
||||||
for child in children.into_iter() {
|
.rows
|
||||||
vstack = vstack.child(child);
|
.extend(children.into_iter().map(|e| Row::Element(Box::new(e))));
|
||||||
}
|
|
||||||
vstack
|
vstack
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue