summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-06-07 13:34:20 +0530
committerSebastian Thiel <sthiel@thoughtworks.com>2019-06-07 13:34:20 +0530
commitf83942b40cd545ee7b6b18e091c273d27a8610a8 (patch)
tree20d3796dc15f969ce573451495905e687df01a99
parent0994466c45e4a46769c6998d87cf532e80108af3 (diff)
Happier clippy
-rw-r--r--src/common.rs2
-rw-r--r--src/interactive/app/handlers.rs6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/common.rs b/src/common.rs
index a9eabff..83b4660 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -60,7 +60,7 @@ impl ByteFormat {
_ => 10,
}
}
- pub fn total_width(&self) -> usize {
+ pub fn total_width(self) -> usize {
use ByteFormat::*;
const THE_SPACE_BETWEEN_UNIT_AND_NUMBER: usize = 1;
diff --git a/src/interactive/app/handlers.rs b/src/interactive/app/handlers.rs
index ceddfd0..a63ab33 100644
--- a/src/interactive/app/handlers.rs
+++ b/src/interactive/app/handlers.rs
@@ -29,7 +29,9 @@ impl CursorDirection {
impl TerminalApp {
pub fn cycle_focus(&mut self) {
use FocussedPane::*;
- self.window.mark_pane.as_mut().map(|p| p.set_focus(false));
+ if let Some(p) = self.window.mark_pane.as_mut() {
+ p.set_focus(false)
+ };
self.state.focussed = match (
self.state.focussed,
&self.window.help_pane,
@@ -70,7 +72,7 @@ impl TerminalApp {
pub fn open_that(&mut self) {
if let Some(ref idx) = self.state.selected {
- open::that(path_of(&self.traversal.tree, *idx)).ok();
+ open::that(path_of(&self.traversal.tree, *idx)).ok();
}
}