Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f83942b

Browse files
author
Sebastian Thiel
committed
Happier clippy
1 parent 0994466 commit f83942b

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl ByteFormat {
6060
_ => 10,
6161
}
6262
}
63-
pub fn total_width(&self) -> usize {
63+
pub fn total_width(self) -> usize {
6464
use ByteFormat::*;
6565
const THE_SPACE_BETWEEN_UNIT_AND_NUMBER: usize = 1;
6666

src/interactive/app/handlers.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ impl CursorDirection {
2929
impl TerminalApp {
3030
pub fn cycle_focus(&mut self) {
3131
use FocussedPane::*;
32-
self.window.mark_pane.as_mut().map(|p| p.set_focus(false));
32+
if let Some(p) = self.window.mark_pane.as_mut() {
33+
p.set_focus(false)
34+
};
3335
self.state.focussed = match (
3436
self.state.focussed,
3537
&self.window.help_pane,
@@ -70,7 +72,7 @@ impl TerminalApp {
7072

7173
pub fn open_that(&mut self) {
7274
if let Some(ref idx) = self.state.selected {
73-
open::that(path_of(&self.traversal.tree, *idx)).ok();
75+
open::that(path_of(&self.traversal.tree, *idx)).ok();
7476
}
7577
}
7678

0 commit comments

Comments
 (0)