Clippy fixes

This commit is contained in:
Rasmus Larsen
2019-05-20 22:32:28 +02:00
parent 1671db14c1
commit 0beaa82a1f
5 changed files with 52 additions and 59 deletions

View File

@@ -13,7 +13,6 @@ use cursive::{Cursive, Printer};
use unicode_width::UnicodeWidthStr;
use command::Command;
use command::Command::Focus;
use commands::CommandResult;
use events;
use traits::{IntoBoxedViewExt, ViewExt};
@@ -207,6 +206,25 @@ impl View for Layout {
}
}
fn layout(&mut self, size: Vec2) {
self.last_size = size;
self.statusbar.layout(Vec2::new(size.x, 2));
self.cmdline.layout(Vec2::new(size.x, 1));
if let Some(screen) = self.get_current_screen_mut() {
screen.view.layout(Vec2::new(size.x, size.y - 3));
}
// the focus view has changed, let the views know so they can redraw
// their items
if self.screenchange {
debug!("layout: new screen selected: {:?}", self.focus);
self.screenchange = false;
}
}
fn required_size(&mut self, constraint: Vec2) -> Vec2 {
Vec2::new(constraint.x, constraint.y)
}
@@ -246,25 +264,6 @@ impl View for Layout {
}
}
fn layout(&mut self, size: Vec2) {
self.last_size = size;
self.statusbar.layout(Vec2::new(size.x, 2));
self.cmdline.layout(Vec2::new(size.x, 1));
if let Some(screen) = self.get_current_screen_mut() {
screen.view.layout(Vec2::new(size.x, size.y - 3));
}
// the focus view has changed, let the views know so they can redraw
// their items
if self.screenchange {
debug!("layout: new screen selected: {:?}", self.focus);
self.screenchange = false;
}
}
fn call_on_any<'a>(&mut self, s: &Selector, c: AnyCb<'a>) {
if let Some(screen) = self.get_current_screen_mut() {
screen.view.call_on_any(s, c);