mirror of
https://github.com/fdehau/tui-rs.git
synced 2024-11-05 12:00:17 +00:00
[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:
parent
ef2054a45b
commit
f96db9c74f
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user