Skip to content

Commit e4bb8c3

Browse files
committed
cargo clippy everywhere
1 parent 07847e1 commit e4bb8c3

File tree

7 files changed

+18
-15
lines changed

7 files changed

+18
-15
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ jobs:
8181
- name: Format check
8282
run: cargo fmt --check
8383
- name: Clippy
84-
run: cargo clippy
84+
run: cargo clippy --workspace --all-targets

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["macros"]
2+
members = ["macros", "testwl"]
33

44
[workspace.dependencies]
55
wayland-client = "0.31.2"
@@ -16,7 +16,8 @@ name = "xwayland-satellite"
1616
version = "0.6.0"
1717
edition = "2021"
1818

19-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
19+
[lints]
20+
workspace = true
2021

2122
[lib]
2223
crate-type = ["lib"]

src/server/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,7 @@ impl<C: XConnection> ServerState<C> {
11991199
let old_role_type = std::mem::discriminant(role);
12001200
assert_eq!(
12011201
new_role_type, old_role_type,
1202-
"Surface for {:?} already had a role: {:?}",
1203-
window, role
1202+
"Surface for {window:?} already had a role: {role:?}"
12041203
);
12051204
}
12061205

src/xstate/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl XState {
330330

331331
match event {
332332
xcb::Event::X(x::Event::CreateNotify(e)) => {
333-
debug!("new window: {:?}", e);
333+
debug!("new window: {e:?}");
334334
server_state.new_window(
335335
e.window(),
336336
e.override_redirect(),
@@ -702,7 +702,7 @@ impl XState {
702702
data.push(0);
703703
}
704704
let class = CString::from_vec_with_nul(data).unwrap();
705-
trace!("{:?} class: {class:?}", window);
705+
trace!("{window:?} class: {class:?}");
706706
class.to_string_lossy().to_string()
707707
};
708708
PropertyCookieWrapper {
@@ -1236,7 +1236,7 @@ impl XConnection for RealConnection {
12361236
revert_to: x::InputFocus::None,
12371237
time: x::CURRENT_TIME,
12381238
}) {
1239-
debug!("SetInputFocus failed ({:?}: {:?})", window, e);
1239+
debug!("SetInputFocus failed ({window:?}: {e:?})");
12401240
return;
12411241
}
12421242
if let Err(e) = self.connection.send_and_check_request(&x::ChangeProperty {
@@ -1246,7 +1246,7 @@ impl XConnection for RealConnection {
12461246
r#type: x::ATOM_WINDOW,
12471247
data: &[window],
12481248
}) {
1249-
debug!("ChangeProperty failed ({:?}: {:?})", window, e);
1249+
debug!("ChangeProperty failed ({window:?}: {e:?})");
12501250
}
12511251
if let Err(e) = self.connection.send_and_check_request(&x::ChangeProperty {
12521252
mode: x::PropMode::Replace,
@@ -1255,7 +1255,7 @@ impl XConnection for RealConnection {
12551255
r#type: self.atoms.wm_state,
12561256
data: &[WmState::Normal as u32, 0],
12571257
}) {
1258-
debug!("ChangeProperty failed ({:?}: {:?})", window, e);
1258+
debug!("ChangeProperty failed ({window:?}: {e:?})");
12591259
}
12601260

12611261
if let Some(name) = output_name {

src/xstate/selection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl XState {
386386
let Some(target) = mimes.iter().find(|t| t.atom == other) else {
387387
if log::log_enabled!(log::Level::Debug) {
388388
let name = get_atom_name(&self.connection, other);
389-
debug!("refusing selection request because given atom could not be found ({})", name);
389+
debug!("refusing selection request because given atom could not be found ({name})");
390390
}
391391
refuse();
392392
return true;
@@ -447,7 +447,7 @@ impl XState {
447447
}
448448

449449
fn handle_new_selection_owner(&mut self, owner: x::Window, timestamp: u32) {
450-
debug!("new selection owner: {:?}", owner);
450+
debug!("new selection owner: {owner:?}");
451451
self.selection_data.last_selection_timestamp = timestamp;
452452
// Grab targets
453453
self.connection

testwl/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name = "testwl"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[lints]
7+
workspace = true
8+
69
[dependencies]
710
wayland-protocols = { workspace = true, features = ["server", "unstable"] }
811
wayland-server.workspace = true

testwl/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ impl State {
365365
.expect("Surface does not exist");
366366
match &mut surface.role {
367367
Some(SurfaceRole::Toplevel(t)) => t,
368-
other => panic!("Surface does not have toplevel role: {:?}", other),
368+
other => panic!("Surface does not have toplevel role: {other:?}"),
369369
}
370370
}
371371

@@ -1283,7 +1283,7 @@ impl Dispatch<XdgToplevel, SurfaceId> for State {
12831283
let states = toplevel.states.clone();
12841284
state.configure_toplevel(*surface_id, 100, 100, states);
12851285
}
1286-
xdg_toplevel::Request::UnsetFullscreen { .. } => {
1286+
xdg_toplevel::Request::UnsetFullscreen => {
12871287
let data = state.surfaces.get_mut(surface_id).unwrap();
12881288
let Some(SurfaceRole::Toplevel(toplevel)) = &mut data.role else {
12891289
unreachable!();
@@ -1667,7 +1667,7 @@ impl Dispatch<WlSurface, ()> for State {
16671667
let data = state
16681668
.surfaces
16691669
.get_mut(&SurfaceId(resource.id().protocol_id()))
1670-
.unwrap_or_else(|| panic!("{:?} missing from surface map", resource));
1670+
.unwrap_or_else(|| panic!("{resource:?} missing from surface map"));
16711671

16721672
match request {
16731673
Attach { buffer, .. } => {

0 commit comments

Comments
 (0)