From 982125508c86ca0841619a175553d61848bd02f7 Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Sun, 6 Nov 2022 13:37:10 +0100 Subject: [PATCH] fix: do not unset the block on render --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0adbfb5..7eec708 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -317,11 +317,11 @@ impl<'a> StatefulWidget for Tree<'a> { type State = TreeState; #[allow(clippy::too_many_lines)] - fn render(mut self, area: Rect, buf: &mut Buffer, state: &mut Self::State) { + fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) { buf.set_style(area, self.style); // Get the inner area inside a possible block, otherwise use the full area - let area = self.block.take().map_or(area, |b| { + let area = self.block.map_or(area, |b| { let inner_area = b.inner(area); b.render(area, buf); inner_area