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

@ -19,7 +19,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const ROLE: u32 = 0;
pub struct WlDataDevice {

View file

@ -12,11 +12,11 @@ use {
};
pub(super) const DND_NONE: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
pub(super) const DND_COPY: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
pub(super) const DND_MOVE: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
pub(super) const DND_ASK: u32 = 4;
pub(super) const DND_ALL: u32 = 7;

View file

@ -21,13 +21,13 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_FINISH: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_ACTION_MASK: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_ACTION: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_OFFER: u32 = 3;
pub struct WlDataOffer {

View file

@ -27,9 +27,9 @@ use {
uapi::OwnedFd,
};
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_ACTION_MASK: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_SOURCE: u32 = 1;
pub struct WlDataSource {

View file

@ -9,9 +9,9 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const NONE: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const CLIENT: u32 = 1;
const SERVER: u32 = 2;

View file

@ -13,9 +13,9 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const NONE: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const CLIENT: u32 = 1;
const SERVER: u32 = 2;

View file

@ -52,7 +52,6 @@ impl WlBuffer {
self.destroyed.get()
}
#[allow(clippy::too_many_arguments)]
pub fn new_dmabuf(
id: WlBufferId,
client: &Rc<Client>,
@ -82,7 +81,7 @@ impl WlBuffer {
}
}
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new_shm(
id: WlBufferId,
client: &Rc<Client>,

View file

@ -12,7 +12,7 @@ use {
const INVALID_OBJECT: u32 = 0;
const INVALID_METHOD: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const NO_MEMORY: u32 = 2;
const IMPLEMENTATION: u32 = 3;

View file

@ -26,15 +26,15 @@ use {
};
const SP_UNKNOWN: i32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_NONE: i32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_HORIZONTAL_RGB: i32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_HORIZONTAL_BGR: i32 = 3;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_VERTICAL_RGB: i32 = 4;
#[allow(dead_code)]
#[expect(dead_code)]
const SP_VERTICAL_BGR: i32 = 5;
pub const TF_NORMAL: i32 = 0;
@ -47,7 +47,7 @@ pub const TF_FLIPPED_180: i32 = 6;
pub const TF_FLIPPED_270: i32 = 7;
const MODE_CURRENT: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const MODE_PREFERRED: u32 = 2;
pub struct WlOutputGlobal {

View file

@ -109,7 +109,7 @@ pub const POINTER: u32 = 1;
const KEYBOARD: u32 = 2;
const TOUCH: u32 = 4;
#[allow(dead_code)]
#[expect(dead_code)]
const MISSING_CAPABILITY: u32 = 0;
pub const BTN_LEFT: u32 = 0x110;

View file

@ -714,7 +714,7 @@ trait NodeSelectorUsecase: Sized + 'static {
fn node_focus(self: &Rc<Self>, seat: &Rc<WlSeatGlobal>, node: &Rc<dyn Node>);
}
impl<U: NodeSelectorUsecase + ?Sized> SimplePointerOwnerUsecase for Rc<U> {
impl<U: NodeSelectorUsecase> SimplePointerOwnerUsecase for Rc<U> {
const FIND_TREE_USECASE: FindTreeUsecase = <U as NodeSelectorUsecase>::FIND_TREE_USECASE;
const IS_DEFAULT: bool = false;

View file

@ -127,7 +127,7 @@ pub enum TabletToolType {
Brush,
Pencil,
Airbrush,
#[allow(dead_code)]
#[expect(dead_code)]
Finger,
Mouse,
Lens,

View file

@ -14,7 +14,7 @@ use {
pub const REPEAT_INFO_SINCE: Version = Version(4);
#[allow(dead_code)]
#[expect(dead_code)]
const NO_KEYMAP: u32 = 0;
pub const XKB_V1: u32 = 1;

View file

@ -12,7 +12,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const ROLE: u32 = 0;
pub(super) const RELEASED: u32 = 0;
@ -24,7 +24,6 @@ pub const HORIZONTAL_SCROLL: u32 = 1;
pub const WHEEL: u32 = 0;
pub const FINGER: u32 = 1;
pub const CONTINUOUS: u32 = 2;
#[allow(dead_code)]
pub const WHEEL_TILT: u32 = 3;
pub const IDENTICAL: u32 = 0;

View file

@ -11,9 +11,9 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
pub const SHAPE_SINCE_VERSION: Version = Version(6);
#[allow(dead_code)]
#[expect(dead_code)]
pub const ORIENTATION_DIRECTION_SINCE_VERSION: Version = Version(6);
pub struct WlTouch {
@ -78,7 +78,7 @@ impl WlTouch {
self.seat.client.event(Cancel { self_id: self.id })
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_shape(&self, id: i32, major: Fixed, minor: Fixed) {
self.seat.client.event(Shape {
self_id: self.id,
@ -88,7 +88,7 @@ impl WlTouch {
})
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_orientation(&self, id: i32, orientation: Fixed) {
self.seat.client.event(Orientation {
self_id: self.id,

View file

@ -11,7 +11,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const BAD_SURFACE: u32 = 0;
pub struct WlSubcompositorGlobal {

View file

@ -96,11 +96,11 @@ use {
zwp_idle_inhibitor_v1::ZwpIdleInhibitorV1,
};
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_SCALE: u32 = 0;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_TRANSFORM: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_SIZE: u32 = 2;
const OFFSET_SINCE: Version = Version(5);
@ -634,7 +634,7 @@ impl WlSurface {
Ok(ext.into_xsurface().unwrap())
}
#[cfg_attr(not(feature = "it"), allow(dead_code))]
#[cfg_attr(not(feature = "it"), expect(dead_code))]
pub fn get_output(&self) -> Rc<OutputNode> {
self.output.get()
}

View file

@ -24,7 +24,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const BAD_SURFACE: u32 = 0;
const MAX_SUBSURFACE_DEPTH: u32 = 100;

View file

@ -37,10 +37,10 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const NOT_CONSTRUCTED: u32 = 1;
const ALREADY_CONSTRUCTED: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const UNCONFIGURED_BUFFER: u32 = 3;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]

View file

@ -30,7 +30,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_GRAB: u32 = 1;
tree_id!(PopupId);

View file

@ -56,10 +56,10 @@ pub enum ResizeEdge {
BottomRight = 10,
}
#[allow(dead_code)]
#[expect(dead_code)]
const STATE_MAXIMIZED: u32 = 1;
const STATE_FULLSCREEN: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const STATE_RESIZING: u32 = 3;
const STATE_ACTIVATED: u32 = 4;
const STATE_TILED_LEFT: u32 = 5;
@ -68,12 +68,12 @@ const STATE_TILED_TOP: u32 = 7;
const STATE_TILED_BOTTOM: u32 = 8;
pub const STATE_SUSPENDED: u32 = 9;
#[allow(dead_code)]
#[expect(dead_code)]
const CAP_WINDOW_MENU: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const CAP_MAXIMIZE: u32 = 2;
const CAP_FULLSCREEN: u32 = 3;
#[allow(dead_code)]
#[expect(dead_code)]
const CAP_MINIMIZE: u32 = 4;
pub const WM_CAPABILITIES_SINCE: Version = Version(5);
@ -81,7 +81,7 @@ pub const SUSPENDED_SINCE: Version = Version(6);
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum Decoration {
#[allow(dead_code)]
#[expect(dead_code)]
Client,
Server,
}

View file

@ -37,7 +37,6 @@ use {
};
const KI_NONE: u32 = 0;
#[allow(dead_code)]
const KI_EXCLUSIVE: u32 = 1;
const KI_ON_DEMAND: u32 = 2;

View file

@ -127,7 +127,7 @@ impl ZwpInputPopupSurfaceV2 {
Ok(())
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_text_input_rectangle(&self, rect: Rect) {
self.client.event(TextInputRectangle {
self_id: self.id,

View file

@ -34,7 +34,7 @@ impl WpDrmLeaseConnectorV1 {
});
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_description(&self, description: &str) {
self.client.event(Description {
self_id: self.id,

View file

@ -19,10 +19,10 @@ pub struct WpPresentationFeedback {
}
pub const KIND_VSYNC: u32 = 0x1;
#[allow(dead_code)]
#[expect(dead_code)]
pub const KIND_HW_CLOCK: u32 = 0x2;
pub const KIND_HW_COMPLETION: u32 = 0x4;
#[allow(dead_code)]
#[expect(dead_code)]
pub const KIND_ZERO_COPY: u32 = 0x8;
impl WpPresentationFeedback {

View file

@ -15,16 +15,16 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const ROLE: u32 = 0;
const DEFUNCT_SURFACES: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const NOT_THE_TOPMOST_POPUP: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_POPUP_PARENT: u32 = 3;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_SURFACE_STATE: u32 = 4;
#[allow(dead_code)]
#[expect(dead_code)]
const INVALID_POSITIONER: u32 = 5;
pub struct XdgWmBaseGlobal {

View file

@ -15,7 +15,7 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
pub const FLAGS_Y_INVERT: u32 = 1;
pub struct ZwlrScreencopyFrameV1 {
@ -81,7 +81,7 @@ impl ZwlrScreencopyFrameV1 {
self.client.event(BufferDone { self_id: self.id })
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_flags(&self, flags: u32) {
self.client.event(Flags {
self_id: self.id,

View file

@ -17,11 +17,11 @@ use {
thiserror::Error,
};
#[allow(dead_code)]
#[expect(dead_code)]
const Y_INVERT: u32 = 1;
#[allow(dead_code)]
#[expect(dead_code)]
const INTERLACED: u32 = 2;
#[allow(dead_code)]
#[expect(dead_code)]
const BOTTOM_FIRST: u32 = 4;
const MAX_PLANE: u32 = MAX_PLANES as u32 - 1;

View file

@ -12,7 +12,6 @@ use {
uapi::{c, OwnedFd},
};
#[allow(dead_code)]
pub const SCANOUT: u32 = 1;
pub struct ZwpLinuxDmabufFeedbackV1 {

View file

@ -11,7 +11,7 @@ use {
};
pub const NAME_SINCE: Version = Version(2);
#[allow(dead_code)]
#[expect(dead_code)]
pub const DESCRIPTION_SINCE: Version = Version(2);
pub const NO_DONE_SINCE: Version = Version(3);
@ -51,7 +51,7 @@ impl ZxdgOutputV1 {
});
}
#[allow(dead_code)]
#[expect(dead_code)]
pub fn send_description(&self, description: &str) {
self.client.event(Description {
self_id: self.id,