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

As the function does not need to mutate state and be run multiple times.
This commit is contained in:
Florian Dehau 2018-05-06 10:15:25 +02:00
parent ef2054a45b
commit f96db9c74f

View File

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