diff options
author | Celti Burroughs <celti@celti.name> | 2018-01-26 15:37:48 -0700 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2018-03-12 23:21:19 -0700 |
commit | b7e0005334da5969e64eccb35517d63e4dd69f8e (patch) | |
tree | fc139b825036a3466d3646061701fdc5bfc99395 | |
parent | 72296b89d53c2d3ae0c4f176a46cb6f3a51c39e3 (diff) | |
download | alacritty-b7e0005334da5969e64eccb35517d63e4dd69f8e.tar.gz alacritty-b7e0005334da5969e64eccb35517d63e4dd69f8e.zip |
Fix clippy lints
-rw-r--r-- | src/input.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/input.rs b/src/input.rs index f765eefc..e8f98794 100644 --- a/src/input.rs +++ b/src/input.rs @@ -298,13 +298,13 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { ) { if self.ctx.mouse_mut().left_button_state == ElementState::Pressed { - self.mouse_report(32 + 0, ElementState::Pressed); + self.mouse_report(32, ElementState::Pressed); } else if self.ctx.mouse_mut().middle_button_state == ElementState::Pressed { - self.mouse_report(32 + 1, ElementState::Pressed); + self.mouse_report(33, ElementState::Pressed); } else if self.ctx.mouse_mut().right_button_state == ElementState::Pressed { - self.mouse_report(32 + 2, ElementState::Pressed); + self.mouse_report(34, ElementState::Pressed); } else if self.ctx.terminal_mode().contains(mode::TermMode::MOUSE_MOTION) { - self.mouse_report(32 + 3, ElementState::Pressed); + self.mouse_report(35, ElementState::Pressed); } } } @@ -341,12 +341,10 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { pub fn mouse_report(&mut self, button: u8, state: ElementState) { if self.ctx.terminal_mode().contains(mode::TermMode::SGR_MOUSE) { self.sgr_mouse_report(button, state); + } else if let ElementState::Released = state { + self.normal_mouse_report(3); } else { - if let ElementState::Released = state { - self.normal_mouse_report(3); - } else { - self.normal_mouse_report(button); - } + self.normal_mouse_report(button); } } |