chore(rustfmt): use nightly (#2325)

Stable rustfmt lacks a lot of features resulting in worse formatted
code, thus use nightly formatter.
This commit is contained in:
Kirill Chibisov 2024-04-26 19:11:44 +04:00 committed by GitHub
parent 7006c7ceca
commit 7b0c7b6cb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
154 changed files with 3439 additions and 5891 deletions

View file

@ -81,12 +81,12 @@ impl SeatHandler for WinitState {
match capability {
SeatCapability::Touch if seat_state.touch.is_none() => {
seat_state.touch = self.seat_state.get_touch(queue_handle, &seat).ok();
}
},
SeatCapability::Keyboard if seat_state.keyboard_state.is_none() => {
let keyboard = seat.get_keyboard(queue_handle, KeyboardData::new(seat.clone()));
seat_state.keyboard_state =
Some(KeyboardState::new(keyboard, self.loop_handle.clone()));
}
},
SeatCapability::Pointer if seat_state.pointer.is_none() => {
let surface = self.compositor_state.create_surface(queue_handle);
let surface_id = surface.id();
@ -114,19 +114,15 @@ impl SeatHandler for WinitState {
let themed_pointer = Arc::new(themed_pointer);
// Register cursor surface.
self.pointer_surfaces
.insert(surface_id, themed_pointer.clone());
self.pointer_surfaces.insert(surface_id, themed_pointer.clone());
seat_state.pointer = Some(themed_pointer);
}
},
_ => (),
}
if let Some(text_input_state) = seat_state
.text_input
.is_none()
.then_some(self.text_input_state.as_ref())
.flatten()
if let Some(text_input_state) =
seat_state.text_input.is_none().then_some(self.text_input_state.as_ref()).flatten()
{
seat_state.text_input = Some(Arc::new(text_input_state.get_text_input(
&seat,
@ -156,7 +152,7 @@ impl SeatHandler for WinitState {
touch.release();
}
}
}
},
SeatCapability::Pointer => {
if let Some(relative_pointer) = seat_state.relative_pointer.take() {
relative_pointer.destroy();
@ -177,11 +173,11 @@ impl SeatHandler for WinitState {
pointer.pointer().release();
}
}
}
},
SeatCapability::Keyboard => {
seat_state.keyboard_state = None;
self.on_keyboard_destroy(&seat.id());
}
},
_ => (),
}
}
@ -213,8 +209,7 @@ impl WinitState {
let had_focus = window.has_focus();
window.remove_seat_focus(seat);
if had_focus != window.has_focus() {
self.events_sink
.push_window_event(WindowEvent::Focused(false), *window_id);
self.events_sink.push_window_event(WindowEvent::Focused(false), *window_id);
}
}
}