Skip to content

Commit

Permalink
Fully remove DeviceId::dummy
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 8, 2024
1 parent 5c99ba4 commit 71faa98
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 80 deletions.
15 changes: 0 additions & 15 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,6 @@ pub enum WindowEvent {
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId(pub(crate) platform_impl::DeviceId);

impl DeviceId {
#[cfg(test)]
pub(crate) const fn dummy() -> Self {
DeviceId(platform_impl::DeviceId::dummy())
}
}

/// Identifier of a finger in a touch event.
///
/// Whenever a touch event is received it contains a `FingerId` which uniquely identifies the finger
Expand Down Expand Up @@ -1148,14 +1141,6 @@ mod tests {
});
let _ = event::StartCause::Init.clone();

let did = crate::event::DeviceId::dummy().clone();
HashSet::new().insert(did);
let mut set = [did, did, did];
set.sort_unstable();
let mut set2 = BTreeSet::new();
set2.insert(did);
set2.insert(did);

let fid = crate::event::FingerId::dummy().clone();
HashSet::new().insert(fid);
let mut set = [fid, fid, fid];
Expand Down
7 changes: 0 additions & 7 deletions src/platform_impl/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,13 +680,6 @@ impl WindowId {
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceId(i32);

impl DeviceId {
#[cfg(test)]
pub const fn dummy() -> Self {
DeviceId(0)
}
}

#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FingerId(i32);

Expand Down
7 changes: 0 additions & 7 deletions src/platform_impl/apple/appkit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ pub(crate) use crate::platform_impl::Fullscreen;
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId;

impl DeviceId {
#[cfg(test)]
pub const fn dummy() -> Self {
DeviceId
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FingerId;

Expand Down
7 changes: 0 additions & 7 deletions src/platform_impl/apple/uikit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ pub(crate) use crate::platform_impl::Fullscreen;
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId;

impl DeviceId {
#[cfg(test)]
pub const fn dummy() -> Self {
DeviceId
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FingerId(usize);

Expand Down
10 changes: 0 additions & 10 deletions src/platform_impl/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,6 @@ pub enum DeviceId {
Wayland(wayland::DeviceId),
}

impl DeviceId {
#[cfg(test)]
pub const fn dummy() -> Self {
#[cfg(wayland_platform)]
return DeviceId::Wayland(wayland::DeviceId::dummy());
#[cfg(all(not(wayland_platform), x11_platform))]
return DeviceId::X(x11::DeviceId::dummy());
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum FingerId {
#[cfg(x11_platform)]
Expand Down
7 changes: 0 additions & 7 deletions src/platform_impl/linux/wayland/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ mod window;
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId;

impl DeviceId {
#[cfg(test)]
pub const fn dummy() -> Self {
DeviceId
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FingerId(i32);

Expand Down
8 changes: 0 additions & 8 deletions src/platform_impl/linux/x11/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,14 +811,6 @@ impl<'a> Deref for DeviceInfo<'a> {
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId(xinput::DeviceId);

impl DeviceId {
#[cfg(test)]
#[allow(unused)]
pub const fn dummy() -> Self {
DeviceId(0)
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FingerId(u32);

Expand Down
7 changes: 0 additions & 7 deletions src/platform_impl/orbital/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ impl WindowId {
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceId;

impl DeviceId {
#[cfg(test)]
pub const fn dummy() -> Self {
DeviceId
}
}

#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FingerId;

Expand Down
5 changes: 0 additions & 5 deletions src/platform_impl/web/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ impl DeviceId {
None
}
}

#[cfg(test)]
pub const fn dummy() -> Self {
Self(0)
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand Down
7 changes: 0 additions & 7 deletions src/platform_impl/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@ unsafe impl Sync for PlatformSpecificWindowAttributes {}
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId(u32);

impl DeviceId {
#[cfg(test)]
pub const fn dummy() -> Self {
DeviceId(0)
}
}

impl DeviceId {
pub fn persistent_identifier(&self) -> Option<String> {
if self.0 != 0 {
Expand Down

0 comments on commit 71faa98

Please sign in to comment.