[layout] Replace FnMut with FnOnce in Group::render

As the function does not need to mutate state and be run multiple times.
pull/53/head
Florian Dehau 6 years ago
parent ef2054a45b
commit f96db9c74f

@ -326,10 +326,10 @@ impl Group {
self.sizes = Vec::from(sizes);
self
}
pub fn render<F, B>(&self, t: &mut Terminal<B>, area: &Rect, mut f: F)
pub fn render<F, B>(&self, t: &mut Terminal<B>, area: &Rect, f: F)
where
B: Backend,
F: FnMut(&mut Terminal<B>, &[Rect]),
F: FnOnce(&mut Terminal<B>, &[Rect]),
{
let chunks = t.compute_layout(self, area);
f(t, &chunks);

Loading…
Cancel
Save