refactor(lint): adapt to lints
This commit is contained in:
+7
-8
@@ -273,14 +273,13 @@ impl<'a> StatefulWidget for Tree<'a> {
|
|||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
fn render(mut self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
|
fn render(mut self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
|
||||||
buf.set_style(area, self.style);
|
buf.set_style(area, self.style);
|
||||||
let area = match self.block.take() {
|
|
||||||
Some(b) => {
|
// Get the inner area inside a possible block, otherwise use the full area
|
||||||
let inner_area = b.inner(area);
|
let area = self.block.take().map_or(area, |b| {
|
||||||
b.render(area, buf);
|
let inner_area = b.inner(area);
|
||||||
inner_area
|
b.render(area, buf);
|
||||||
}
|
inner_area
|
||||||
None => area,
|
});
|
||||||
};
|
|
||||||
|
|
||||||
if area.width < 1 || area.height < 1 {
|
if area.width < 1 || area.height < 1 {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user