1
0
Fork 0
forked from wry/wry

Merge pull request #745 from mahkoh/jorth/not-matches

all: use not_matches macro
This commit is contained in:
mahkoh 2026-02-16 20:25:41 +01:00 committed by GitHub
commit aa40e5f360
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 11 deletions

View file

@ -840,7 +840,7 @@ pub enum XdgToplevelError {
efrom!(XdgToplevelError, ClientError); efrom!(XdgToplevelError, ClientError);
pub fn map_resize_edges(edge: u32) -> Option<ResizeEdges> { pub fn map_resize_edges(edge: u32) -> Option<ResizeEdges> {
if !matches!(edge, 0 | 1 | 2 | 4 | 5 | 6 | 8 | 9 | 10) { if not_matches!(edge, 0 | 1 | 2 | 4 | 5 | 6 | 8 | 9 | 10) {
return None; return None;
} }
Some(ResizeEdges { Some(ResizeEdges {

View file

@ -380,7 +380,7 @@ impl IoUringData {
to_submit -= n; to_submit -= n;
} }
Err(e) => { Err(e) => {
if !matches!(e.0, c::EAGAIN | c::EBUSY | c::EINTR) { if not_matches!(e.0, c::EAGAIN | c::EBUSY | c::EINTR) {
return Err(IoUringError::Enter(e)); return Err(IoUringError::Enter(e));
} }
} }

View file

@ -74,7 +74,7 @@ impl UdmabufHolder {
self.logged.exec(|| { self.logged.exec(|| {
log::warn!("Unable to open /dev/udmabuf: {}", ErrorFmt(&e)); log::warn!("Unable to open /dev/udmabuf: {}", ErrorFmt(&e));
}); });
if !matches!(e, UdmabufError::Open(OsError(c::EPERM))) { if not_matches!(e, UdmabufError::Open(OsError(c::EPERM))) {
self.udmabuf.set(Some(None)); self.udmabuf.set(Some(None));
} }
None None

View file

@ -28,7 +28,7 @@ pub unsafe fn ioctl<T>(fd: c::c_int, request: c::c_ulong, t: &mut T) -> Result<c
return Ok(ret); return Ok(ret);
} }
let err = uapi::get_errno(); let err = uapi::get_errno();
if !matches!(err, c::EINTR | c::EAGAIN) { if not_matches!(err, c::EINTR | c::EAGAIN) {
return Err(OsError(err)); return Err(OsError(err));
} }
} }

View file

@ -1227,7 +1227,7 @@ impl Wm {
.get_property::<u32>(data.window_id, ATOM_WM_TRANSIENT_FOR, ATOM_WINDOW, &mut buf) .get_property::<u32>(data.window_id, ATOM_WM_TRANSIENT_FOR, ATOM_WINDOW, &mut buf)
.await .await
{ {
if !matches!(e, XconError::PropertyUnavailable) { if not_matches!(e, XconError::PropertyUnavailable) {
log::error!( log::error!(
"Could not retrieve WM_TRANSIENT_FOR property: {}", "Could not retrieve WM_TRANSIENT_FOR property: {}",
ErrorFmt(e) ErrorFmt(e)
@ -1256,7 +1256,7 @@ impl Wm {
.get_property::<u32>(data.window_id, self.atoms.WM_PROTOCOLS, ATOM_ATOM, &mut buf) .get_property::<u32>(data.window_id, self.atoms.WM_PROTOCOLS, ATOM_ATOM, &mut buf)
.await .await
{ {
if !matches!(e, XconError::PropertyUnavailable) { if not_matches!(e, XconError::PropertyUnavailable) {
log::error!("Could not retrieve WM_PROTOCOLS property: {}", ErrorFmt(e)); log::error!("Could not retrieve WM_PROTOCOLS property: {}", ErrorFmt(e));
} }
return; return;
@ -1276,7 +1276,7 @@ impl Wm {
.get_property::<u32>(data.window_id, self.atoms.WM_HINTS, 0, &mut buf) .get_property::<u32>(data.window_id, self.atoms.WM_HINTS, 0, &mut buf)
.await .await
{ {
if !matches!(e, XconError::PropertyUnavailable) { if not_matches!(e, XconError::PropertyUnavailable) {
log::error!("Could not retrieve WM_HINTS property: {}", ErrorFmt(e)); log::error!("Could not retrieve WM_HINTS property: {}", ErrorFmt(e));
} }
data.info.icccm_hints.input.set(true); data.info.icccm_hints.input.set(true);
@ -1319,7 +1319,7 @@ impl Wm {
) )
.await .await
{ {
if !matches!(e, XconError::PropertyUnavailable) { if not_matches!(e, XconError::PropertyUnavailable) {
log::error!( log::error!(
"Could not retrieve WM_NORMAL_HINTS property: {}", "Could not retrieve WM_NORMAL_HINTS property: {}",
ErrorFmt(e) ErrorFmt(e)
@ -1358,7 +1358,7 @@ impl Wm {
.get_property::<u32>(data.window_id, self.atoms._MOTIF_WM_HINTS, 0, &mut buf) .get_property::<u32>(data.window_id, self.atoms._MOTIF_WM_HINTS, 0, &mut buf)
.await .await
{ {
if !matches!(e, XconError::PropertyUnavailable) { if not_matches!(e, XconError::PropertyUnavailable) {
log::error!( log::error!(
"Could not retrieve _MOTIF_WM_HINTS property: {}", "Could not retrieve _MOTIF_WM_HINTS property: {}",
ErrorFmt(e) ErrorFmt(e)
@ -1413,7 +1413,7 @@ impl Wm {
.get_property::<u32>(data.window_id, self.atoms._NET_WM_STATE, 0, &mut buf) .get_property::<u32>(data.window_id, self.atoms._NET_WM_STATE, 0, &mut buf)
.await .await
{ {
if !matches!(e, XconError::PropertyUnavailable) { if not_matches!(e, XconError::PropertyUnavailable) {
log::error!("Could not retrieve _NET_WM_STATE property: {}", ErrorFmt(e)); log::error!("Could not retrieve _NET_WM_STATE property: {}", ErrorFmt(e));
} }
return; return;
@ -1446,7 +1446,7 @@ impl Wm {
) )
.await .await
{ {
if !matches!(e, XconError::PropertyUnavailable) { if not_matches!(e, XconError::PropertyUnavailable) {
log::error!( log::error!(
"Could not retrieve _NET_WM_WINDOW_TYPE property: {}", "Could not retrieve _NET_WM_WINDOW_TYPE property: {}",
ErrorFmt(e) ErrorFmt(e)