1
0
Fork 0
forked from wry/wry

all: use expect attribute where possible

This commit is contained in:
Julian Orth 2024-09-06 11:08:22 +02:00
parent c3b50dc653
commit e377470f3f
134 changed files with 241 additions and 296 deletions

View file

@ -13,7 +13,7 @@ pub struct TestCursorShapeDevice {
}
impl TestCursorShapeDevice {
#[allow(dead_code)]
#[expect(dead_code)]
pub fn destroy(&self) -> TestResult {
if !self.destroyed.replace(true) {
self.tran.send(Destroy { self_id: self.id })?;

View file

@ -28,7 +28,7 @@ impl TestCursorShapeManager {
}
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn destroy(&self) -> TestResult {
if !self.destroyed.replace(true) {
self.tran.send(Destroy { self_id: self.id })?;

View file

@ -29,7 +29,7 @@ pub struct TestDataControlDevice {
}
impl TestDataControlDevice {
#[allow(dead_code)]
#[expect(dead_code)]
pub fn destroy(&self) -> TestResult {
if !self.destroyed.replace(true) {
self.tran.send(Destroy { self_id: self.id })?;
@ -45,7 +45,7 @@ impl TestDataControlDevice {
Ok(())
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn set_primary_selection(&self, source: &TestDataControlSource) -> TestResult {
self.tran.send(SetPrimarySelection {
self_id: self.id,

View file

@ -47,7 +47,6 @@ impl TestDataDevice {
Ok(())
}
#[allow(dead_code)]
pub fn set_selection(&self, source: &TestDataSource, serial: u32) -> TestResult {
self.tran.send(SetSelection {
self_id: self.id,

View file

@ -26,7 +26,6 @@ impl TestDataSource {
Ok(())
}
#[allow(dead_code)]
pub fn offer(&self, mime_type: &str) -> TestResult {
self.tran.send(Offer {
self_id: self.id,
@ -35,7 +34,6 @@ impl TestDataSource {
Ok(())
}
#[allow(dead_code)]
pub fn set_actions(&self, actions: u32) -> TestResult {
self.tran.send(SetActions {
self_id: self.id,

View file

@ -33,7 +33,7 @@ impl TestDmabuf {
Ok(())
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn get_default_feedback(&self) -> TestResult<Rc<TestDmabufFeedback>> {
let obj = Rc::new(TestDmabufFeedback::new(&self.tran));
self.tran.add_obj(obj.clone())?;

View file

@ -33,7 +33,7 @@ impl TestExtForeignToplevelList {
}
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn stop(&self) -> TestResult {
self.tran.send(Stop { self_id: self.id })?;
Ok(())

View file

@ -41,7 +41,7 @@ impl TestInputMethod {
})
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn grab(&self) -> TestResult<Rc<TestInputMethodKeyboardGrab>> {
let obj = Rc::new(TestInputMethodKeyboardGrab {
id: self.tran.id(),

View file

@ -39,7 +39,6 @@ impl TestShm {
&self.formats
}
#[allow(dead_code)]
pub fn create_pool(&self, size: usize) -> Result<Rc<TestShmPool>, TestError> {
let mem = TestMem::new(size)?;
let pool = Rc::new(TestShmPool {
@ -58,7 +57,6 @@ impl TestShm {
Ok(pool)
}
#[allow(dead_code)]
pub fn create_buffer(&self, width: i32, height: i32) -> TestResult<Rc<TestShmBuffer>> {
let pool = self.create_pool((width * height * 4) as _)?;
pool.create_buffer(0, width, height, width * 4, ARGB8888)

View file

@ -18,7 +18,6 @@ pub struct TestShmBuffer {
}
impl TestShmBuffer {
#[allow(dead_code)]
pub fn fill(&self, color: Color) {
let [cr, cg, cb, ca] = color.to_rgba_premultiplied();
for [b, g, r, a] in self.deref().array_chunks_ext::<4>() {

View file

@ -22,7 +22,6 @@ pub struct TestShmPool {
}
impl TestShmPool {
#[allow(dead_code)]
pub fn create_buffer(
&self,
offset: i32,
@ -61,7 +60,7 @@ impl TestShmPool {
Ok(buffer)
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn resize(&self, size: usize) -> Result<(), TestError> {
let mem = self.mem.get().grow(size)?;
self.mem.set(mem);

View file

@ -44,12 +44,11 @@ impl TestSubsurface {
})
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn set_sync(&self) -> Result<(), TestError> {
self.tran.send(SetSync { self_id: self.id })
}
#[allow(dead_code)]
pub fn set_desync(&self) -> Result<(), TestError> {
self.tran.send(SetDesync { self_id: self.id })
}