Skip to content

Commit 6fa830f

Browse files
committed
Fix obfuscated_if_else lint issues
1 parent e1ab9db commit 6fa830f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/modules/show_commit.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,13 @@ impl Module for ShowCommit {
125125
fn read_event(&self, event: Event, key_bindings: &KeyBindings) -> Event {
126126
select!(
127127
default {
128-
key_bindings
129-
.show_diff
130-
.contains(&event)
131-
.then(|| Event::from(StandardEvent::ShowDiff))
132-
.unwrap_or(event)
128+
let has_event = key_bindings.show_diff.contains(&event);
129+
if has_event {
130+
Event::from(StandardEvent::ShowDiff)
131+
}
132+
else {
133+
event
134+
}
133135
},
134136
self.help.read_event(event)
135137
)

0 commit comments

Comments
 (0)