1
0
Fork 0
forked from wry/wry

all: address clippy lints

This commit is contained in:
Julian Orth 2024-07-02 17:11:34 +02:00
parent 498e01a8bb
commit 84d7632341
43 changed files with 170 additions and 149 deletions

View file

@ -12,7 +12,7 @@ use {
pub struct TestCallback {
pub id: WlCallbackId,
pub tran: Rc<TestTransport>,
pub _tran: Rc<TestTransport>,
pub handler: Cell<Option<Box<dyn FnOnce()>>>,
pub done: Cell<bool>,
}

View file

@ -34,9 +34,9 @@ pub struct PendingFeedback {
}
pub struct Feedback {
pub format_table: Rc<OwnedFd>,
pub format_table_size: usize,
pub main_device: c::dev_t,
pub _format_table: Rc<OwnedFd>,
pub _format_table_size: usize,
pub _main_device: c::dev_t,
pub tranches: Vec<Tranche>,
}
@ -69,12 +69,12 @@ impl TestDmabufFeedback {
let _ev = Done::parse_full(parser)?;
let mut pending = mem::take(self.pending_feedback.borrow_mut().deref_mut());
self.feedback.push(Feedback {
format_table: match pending.format_table.take() {
_format_table: match pending.format_table.take() {
None => bail!("compositor did not send format table"),
Some(ft) => ft,
},
format_table_size: pending.format_table_size,
main_device: pending.main_device,
_format_table_size: pending.format_table_size,
_main_device: pending.main_device,
tranches: pending.tranches,
});
Ok(())

View file

@ -14,7 +14,7 @@ use {
pub struct TestEnterEvent {
pub serial: u32,
pub surface: WlSurfaceId,
pub keys: Vec<u32>,
pub _keys: Vec<u32>,
}
pub struct TestKeyboard {
@ -49,7 +49,7 @@ impl TestKeyboard {
self.enter.push(TestEnterEvent {
serial: ev.serial,
surface: ev.surface,
keys: ev.keys.to_vec(),
_keys: ev.keys.to_vec(),
});
Ok(())
}

View file

@ -34,7 +34,7 @@ use {
pub struct TestGlobal {
pub name: u32,
pub interface: String,
pub version: u32,
pub _version: u32,
}
pub struct TestRegistrySingletons {
@ -294,7 +294,7 @@ impl TestRegistry {
let global = Rc::new(TestGlobal {
name: ev.name,
interface: ev.interface.to_string(),
version: ev.version,
_version: ev.version,
});
let prev = self.globals.set(ev.name, global.clone());
let name = GlobalName::from_raw(ev.name);

View file

@ -48,7 +48,7 @@ impl TestSubcompositor {
id,
tran: self.tran.clone(),
destroyed: Cell::new(false),
server: self.tran.get_server_obj(id)?,
_server: self.tran.get_server_obj(id)?,
});
self.tran.add_obj(ss.clone())?;
Ok(ss)

View file

@ -11,7 +11,7 @@ pub struct TestSubsurface {
pub id: WlSubsurfaceId,
pub tran: Rc<TestTransport>,
pub destroyed: Cell<bool>,
pub server: Rc<WlSubsurface>,
pub _server: Rc<WlSubsurface>,
}
impl TestSubsurface {

View file

@ -14,7 +14,7 @@ use {
pub struct TestVirtualKeyboardManager {
pub id: ZwpVirtualKeyboardManagerV1Id,
pub tran: Rc<TestTransport>,
pub destroyed: Cell<bool>,
pub _destroyed: Cell<bool>,
}
impl TestVirtualKeyboardManager {
@ -22,7 +22,7 @@ impl TestVirtualKeyboardManager {
Self {
id: tran.id(),
tran: tran.clone(),
destroyed: Cell::new(false),
_destroyed: Cell::new(false),
}
}

View file

@ -48,7 +48,7 @@ impl TestXdgWmBase {
let xdg = Rc::new(TestXdgSurface {
id,
tran: self.tran.clone(),
server,
_server: server,
destroyed: Cell::new(false),
last_serial: Cell::new(0),
});

View file

@ -17,7 +17,7 @@ use {
pub struct TestXdgSurface {
pub id: XdgSurfaceId,
pub tran: Rc<TestTransport>,
pub server: Rc<XdgSurface>,
pub _server: Rc<XdgSurface>,
pub destroyed: Cell<bool>,
pub last_serial: Cell<u32>,
}

View file

@ -114,7 +114,7 @@ impl TestTransport {
pub fn sync(self: &Rc<Self>) -> impl Future<Output = ()> {
let cb = Rc::new(TestCallback {
id: self.id(),
tran: self.clone(),
_tran: self.clone(),
handler: Cell::new(None),
done: Cell::new(self.killed.get()),
});