Use from() rather than into()

This commit is contained in:
Poly 2022-06-05 01:30:10 +02:00 committed by Victoria Brekenfeld
parent 76ab50cde8
commit 21ffc6677d
2 changed files with 5 additions and 4 deletions

View file

@ -137,7 +137,7 @@ impl<Backend> AnvilState<Backend> {
let serial = SCOUNTER.next_serial();
let button = evt.button_code();
let state: wl_pointer::ButtonState = evt.state().into();
let state = wl_pointer::ButtonState::from(evt.state());
if wl_pointer::ButtonState::Pressed == state {
self.update_keyboard_focus(dh, serial);
@ -285,7 +285,8 @@ impl<Backend> AnvilState<Backend> {
}
fn on_pointer_axis<B: InputBackend>(&mut self, dh: &DisplayHandle, evt: B::PointerAxisEvent) {
let source: wl_pointer::AxisSource = evt.source().into();
let source = wl_pointer::AxisSource::from(evt.source());
let horizontal_amount = evt
.amount(input::Axis::Horizontal)
.unwrap_or_else(|| evt.amount_discrete(input::Axis::Horizontal).unwrap() * 3.0);

View file

@ -68,7 +68,7 @@ impl Smallvil {
let button = event.button_code();
let button_state: wl_pointer::ButtonState = event.state().into();
let button_state = wl_pointer::ButtonState::from(event.state());
if wl_pointer::ButtonState::Pressed == button_state && !pointer.is_grabbed() {
if let Some(window) = self.space.window_under(self.pointer_location).cloned() {
@ -97,7 +97,7 @@ impl Smallvil {
);
}
InputEvent::PointerAxis { event, .. } => {
let source: wl_pointer::AxisSource = event.source().into();
let source = wl_pointer::AxisSource::from(event.source());
let horizontal_amount = event
.amount(Axis::Horizontal)