New clippy fixes
This commit is contained in:
parent
8fde779806
commit
36e11284c2
|
@ -48,11 +48,7 @@ impl AnvilState {
|
||||||
action = process_keyboard_shortcut(*modifiers, keysym);
|
action = process_keyboard_shortcut(*modifiers, keysym);
|
||||||
// forward to client only if action == KeyAction::Forward
|
// forward to client only if action == KeyAction::Forward
|
||||||
// both for pressed and released, to avoid inconsistencies
|
// both for pressed and released, to avoid inconsistencies
|
||||||
if let KeyAction::Forward = action {
|
matches!(action, KeyAction::Forward)
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
if let KeyState::Released = state {
|
if let KeyState::Released = state {
|
||||||
// only process special actions on key press, not release
|
// only process special actions on key press, not release
|
||||||
|
|
|
@ -675,19 +675,15 @@ impl DrmRenderer {
|
||||||
|
|
||||||
if let Err(err) = frame.finish() {
|
if let Err(err) = frame.finish() {
|
||||||
warn!(self.logger, "Error during rendering: {:?}", err);
|
warn!(self.logger, "Error during rendering: {:?}", err);
|
||||||
let reschedule = match err {
|
let reschedule =
|
||||||
|
match err {
|
||||||
SwapBuffersError::AlreadySwapped => false,
|
SwapBuffersError::AlreadySwapped => false,
|
||||||
SwapBuffersError::TemporaryFailure(err) => {
|
SwapBuffersError::TemporaryFailure(err) => {
|
||||||
match err.downcast_ref::<smithay::backend::drm::common::Error>() {
|
match err.downcast_ref::<smithay::backend::drm::common::Error>() {
|
||||||
Some(&smithay::backend::drm::common::Error::DeviceInactive) => false,
|
Some(&smithay::backend::drm::common::Error::DeviceInactive) => false,
|
||||||
Some(&smithay::backend::drm::common::Error::Access { ref source, .. })
|
Some(&smithay::backend::drm::common::Error::Access {
|
||||||
if match source.get_ref() {
|
ref source, ..
|
||||||
drm::SystemError::PermissionDenied => true,
|
}) if matches!(source.get_ref(), drm::SystemError::PermissionDenied) => false,
|
||||||
_ => false,
|
|
||||||
} =>
|
|
||||||
{
|
|
||||||
false
|
|
||||||
}
|
|
||||||
_ => true,
|
_ => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
//! Types to make fallback device initialization easier
|
//! Types to make fallback device initialization easier
|
||||||
//!
|
//!
|
||||||
|
|
||||||
|
// The macros in this module rely on these constructs
|
||||||
|
#![allow(clippy::needless_arbitrary_self_type)]
|
||||||
|
|
||||||
#[cfg(feature = "backend_drm_egl")]
|
#[cfg(feature = "backend_drm_egl")]
|
||||||
use crate::backend::drm::egl::{Arguments as EglDeviceArguments, EglDevice, Error as EglDeviceError};
|
use crate::backend::drm::egl::{Arguments as EglDeviceArguments, EglDevice, Error as EglDeviceError};
|
||||||
#[cfg(all(feature = "backend_drm_atomic", feature = "backend_drm_legacy"))]
|
#[cfg(all(feature = "backend_drm_atomic", feature = "backend_drm_legacy"))]
|
||||||
|
|
|
@ -103,11 +103,10 @@ impl<N: native::NativeSurface> EGLSurface<N> {
|
||||||
};
|
};
|
||||||
|
|
||||||
// workaround for missing `PartialEq` impl
|
// workaround for missing `PartialEq` impl
|
||||||
let is_bad_surface = if let Err(SwapBuffersError::EGLSwapBuffers(EGLError::BadSurface)) = result {
|
let is_bad_surface = matches!(
|
||||||
true
|
result,
|
||||||
} else {
|
Err(SwapBuffersError::EGLSwapBuffers(EGLError::BadSurface))
|
||||||
false
|
);
|
||||||
};
|
|
||||||
|
|
||||||
if self.native.needs_recreation() || surface.is_null() || is_bad_surface {
|
if self.native.needs_recreation() || surface.is_null() || is_bad_surface {
|
||||||
let previous = self.surface.compare_and_swap(
|
let previous = self.surface.compare_and_swap(
|
||||||
|
|
|
@ -160,10 +160,7 @@ impl PointerHandle {
|
||||||
/// Check if this pointer is currently being grabbed
|
/// Check if this pointer is currently being grabbed
|
||||||
pub fn is_grabbed(&self) -> bool {
|
pub fn is_grabbed(&self) -> bool {
|
||||||
let guard = self.inner.borrow_mut();
|
let guard = self.inner.borrow_mut();
|
||||||
match guard.grab {
|
!matches!(guard.grab, GrabStatus::None)
|
||||||
GrabStatus::None => false,
|
|
||||||
_ => true,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the start data for the grab, if any.
|
/// Returns the start data for the grab, if any.
|
||||||
|
|
Loading…
Reference in New Issue