diff options
author | Celti Burroughs <celti@celti.name> | 2018-01-26 15:23:04 -0700 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2018-03-12 23:21:19 -0700 |
commit | 72296b89d53c2d3ae0c4f176a46cb6f3a51c39e3 (patch) | |
tree | 063af2f69f772cfefa6646282354b752632b54a6 /src/input.rs | |
parent | fb43c73a38e7941f4208e17f3428c21006f29299 (diff) | |
download | alacritty-72296b89d53c2d3ae0c4f176a46cb6f3a51c39e3.tar.gz alacritty-72296b89d53c2d3ae0c4f176a46cb6f3a51c39e3.zip |
Rename button_state to prev_state for clarity
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input.rs b/src/input.rs index 06fd5e5b..f765eefc 100644 --- a/src/input.rs +++ b/src/input.rs @@ -494,7 +494,7 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { } pub fn mouse_input(&mut self, state: ElementState, button: MouseButton, modifiers: ModifiersState) { - let button_state = match button { + let prev_state = match button { MouseButton::Left => Some(mem::replace(&mut self.ctx.mouse_mut().left_button_state, state)), MouseButton::Middle => Some(mem::replace(&mut self.ctx.mouse_mut().middle_button_state, state)), MouseButton::Right => Some(mem::replace(&mut self.ctx.mouse_mut().right_button_state, state)), @@ -502,8 +502,8 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { MouseButton::Other(_) => None, }; - if let Some(button_state) = button_state { - if button_state != state { + if let Some(prev_state) = prev_state { + if prev_state != state { match state { ElementState::Pressed => self.on_mouse_press(button, modifiers), ElementState::Released => self.on_mouse_release(button, modifiers), |