cargo fmt + cargo clippy
This commit is contained in:
parent
47e7357eab
commit
ba9c1a6a3e
4 changed files with 16 additions and 25 deletions
|
|
@ -545,7 +545,7 @@ impl HandleEvent for Keyboard {
|
||||||
if let Some(data) = state
|
if let Some(data) = state
|
||||||
.objects
|
.objects
|
||||||
.get(key)
|
.get(key)
|
||||||
.map(|o| <_ as AsRef<SurfaceData>>::as_ref(o))
|
.map(<_ as AsRef<SurfaceData>>::as_ref)
|
||||||
{
|
{
|
||||||
state.last_kb_serial = Some(serial);
|
state.last_kb_serial = Some(serial);
|
||||||
let output_name = data.get_output_name(state);
|
let output_name = data.get_output_name(state);
|
||||||
|
|
@ -564,7 +564,7 @@ impl HandleEvent for Keyboard {
|
||||||
if let Some(data) = state
|
if let Some(data) = state
|
||||||
.objects
|
.objects
|
||||||
.get(key)
|
.get(key)
|
||||||
.map(|o| <_ as AsRef<SurfaceData>>::as_ref(o))
|
.map(<_ as AsRef<SurfaceData>>::as_ref)
|
||||||
{
|
{
|
||||||
if state.to_focus.as_ref().map(|d| d.window) == Some(data.window.unwrap()) {
|
if state.to_focus.as_ref().map(|d| d.window) == Some(data.window.unwrap()) {
|
||||||
state.to_focus.take();
|
state.to_focus.take();
|
||||||
|
|
@ -741,7 +741,7 @@ impl Output {
|
||||||
state.connection.as_mut().unwrap(),
|
state.connection.as_mut().unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
return true;
|
true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
fn wl_event<C: XConnection>(
|
fn wl_event<C: XConnection>(
|
||||||
|
|
|
||||||
|
|
@ -679,7 +679,7 @@ impl<C: XConnection> ServerState<C> {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
!(win.mapped && !win.attrs.override_redirect)
|
!win.mapped || win.attrs.override_redirect
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn reconfigure_window(&mut self, event: x::ConfigureNotifyEvent) {
|
pub fn reconfigure_window(&mut self, event: x::ConfigureNotifyEvent) {
|
||||||
|
|
|
||||||
|
|
@ -749,9 +749,9 @@ where
|
||||||
backend: &Backend,
|
backend: &Backend,
|
||||||
msg: Message<ObjectId, std::os::fd::OwnedFd>,
|
msg: Message<ObjectId, std::os::fd::OwnedFd>,
|
||||||
) -> Option<Arc<dyn ObjectData>> {
|
) -> Option<Arc<dyn ObjectData>> {
|
||||||
fn obj_data<T: Proxy>() -> Arc<dyn ObjectData>
|
fn obj_data<T>() -> Arc<dyn ObjectData>
|
||||||
where
|
where
|
||||||
T: Send + Sync + 'static,
|
T: Proxy + Send + Sync + 'static,
|
||||||
T::Event: Send + Sync + std::fmt::Debug,
|
T::Event: Send + Sync + std::fmt::Debug,
|
||||||
{
|
{
|
||||||
Arc::new(TestObjectData::<T>::default())
|
Arc::new(TestObjectData::<T>::default())
|
||||||
|
|
@ -1143,7 +1143,6 @@ fn window_group_properties() {
|
||||||
win,
|
win,
|
||||||
super::WmHints {
|
super::WmHints {
|
||||||
window_group: Some(prop_win),
|
window_group: Some(prop_win),
|
||||||
..Default::default()
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
f.satellite.map_window(win);
|
f.satellite.map_window(win);
|
||||||
|
|
@ -1524,10 +1523,11 @@ fn ignore_toplevel_reconfigure() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type EventMatcher<'a, Event> = Box<dyn FnMut(&Event) -> bool + 'a>;
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
fn events_check<'a, Event: std::fmt::Debug, const N: usize>(
|
fn events_check<Event: std::fmt::Debug, const N: usize>(
|
||||||
mut it: impl Iterator<Item = Event>,
|
mut it: impl Iterator<Item = Event>,
|
||||||
mut matchers: [Box<dyn FnMut(&Event) -> bool + 'a>; N],
|
mut matchers: [EventMatcher<'_, Event>; N],
|
||||||
) {
|
) {
|
||||||
for (idx, matcher) in matchers.iter_mut().enumerate() {
|
for (idx, matcher) in matchers.iter_mut().enumerate() {
|
||||||
let item = it.next();
|
let item = it.next();
|
||||||
|
|
@ -1595,10 +1595,7 @@ fn tablet_smoke_test() {
|
||||||
events_check(
|
events_check(
|
||||||
tab_events,
|
tab_events,
|
||||||
[
|
[
|
||||||
Box::new(|e| match e {
|
Box::new(|e| matches!(e, zwp_tablet_v2::Event::Name { name } if name == "tabby")),
|
||||||
zwp_tablet_v2::Event::Name { name } if name == "tabby" => true,
|
|
||||||
_ => false,
|
|
||||||
}),
|
|
||||||
Box::new(|e| matches!(e, zwp_tablet_v2::Event::Done)),
|
Box::new(|e| matches!(e, zwp_tablet_v2::Event::Done)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
@ -1644,9 +1641,9 @@ fn tablet_smoke_test() {
|
||||||
events_check(
|
events_check(
|
||||||
g_events,
|
g_events,
|
||||||
[
|
[
|
||||||
Box::new(|e| match e {
|
Box::new(|e| {
|
||||||
zwp_tablet_pad_group_v2::Event::Buttons { buttons } if buttons.is_empty() => true,
|
matches!(e,
|
||||||
_ => false,
|
zwp_tablet_pad_group_v2::Event::Buttons { buttons } if buttons.is_empty())
|
||||||
}),
|
}),
|
||||||
Box::new(|e| matches!(e, zwp_tablet_pad_group_v2::Event::Ring { .. })),
|
Box::new(|e| matches!(e, zwp_tablet_pad_group_v2::Event::Ring { .. })),
|
||||||
Box::new(|e| matches!(e, zwp_tablet_pad_group_v2::Event::Strip { .. })),
|
Box::new(|e| matches!(e, zwp_tablet_pad_group_v2::Event::Strip { .. })),
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,6 @@ struct DataSourceData {
|
||||||
|
|
||||||
struct Output {
|
struct Output {
|
||||||
name: String,
|
name: String,
|
||||||
wl: WlOutput,
|
|
||||||
xdg: Option<ZxdgOutputV1>,
|
xdg: Option<ZxdgOutputV1>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -827,14 +826,9 @@ impl GlobalDispatch<WlOutput, (i32, i32)> for State {
|
||||||
output.name(name.clone());
|
output.name(name.clone());
|
||||||
output.mode(wl_output::Mode::Current, 1000, 1000, 0);
|
output.mode(wl_output::Mode::Current, 1000, 1000, 0);
|
||||||
output.done();
|
output.done();
|
||||||
state.outputs.insert(
|
state
|
||||||
output.clone(),
|
.outputs
|
||||||
Output {
|
.insert(output.clone(), Output { name, xdg: None });
|
||||||
name,
|
|
||||||
wl: output.clone(),
|
|
||||||
xdg: None,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
state.last_output = Some(output);
|
state.last_output = Some(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue