mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-25 22:20:53 +03:00
fix clippy warnings
This commit is contained in:
@@ -73,12 +73,12 @@ pub enum CaptureCreationError {
|
||||
impl CaptureCreationError {
|
||||
/// request was intentionally denied by the user
|
||||
pub(crate) fn cancelled_by_user(&self) -> bool {
|
||||
match self {
|
||||
CaptureCreationError::Libei(LibeiCaptureCreationError::Ashpd(
|
||||
ashpd::Error::Response(ResponseError::Cancelled),
|
||||
)) => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(
|
||||
self,
|
||||
CaptureCreationError::Libei(LibeiCaptureCreationError::Ashpd(ashpd::Error::Response(
|
||||
ResponseError::Cancelled
|
||||
)))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -290,8 +290,7 @@ async fn do_capture<'a>(
|
||||
&mut active_clients,
|
||||
&mut next_barrier_id,
|
||||
¬ify_release,
|
||||
cancel_session.clone(),
|
||||
cancel_update.clone(),
|
||||
(cancel_session.clone(), cancel_update.clone()),
|
||||
);
|
||||
|
||||
let (capture_result, ()) = tokio::join!(capture_session, handle_session_update_request);
|
||||
@@ -334,9 +333,9 @@ async fn do_capture_session(
|
||||
active_clients: &mut Vec<(CaptureHandle, Position)>,
|
||||
next_barrier_id: &mut u32,
|
||||
notify_release: &Notify,
|
||||
cancel_session: CancellationToken,
|
||||
cancel_update: CancellationToken,
|
||||
cancel: (CancellationToken, CancellationToken),
|
||||
) -> Result<(), CaptureError> {
|
||||
let (cancel_session, cancel_update) = cancel;
|
||||
// current client
|
||||
let current_client = Rc::new(Cell::new(None));
|
||||
|
||||
|
||||
@@ -79,15 +79,14 @@ pub enum EmulationCreationError {
|
||||
impl EmulationCreationError {
|
||||
/// request was intentionally denied by the user
|
||||
pub(crate) fn cancelled_by_user(&self) -> bool {
|
||||
match self {
|
||||
matches!(
|
||||
self,
|
||||
EmulationCreationError::Libei(LibeiEmulationCreationError::Ashpd(Response(
|
||||
ResponseError::Cancelled,
|
||||
)))
|
||||
| EmulationCreationError::Xdp(XdpEmulationCreationError::Ashpd(Response(
|
||||
))) | EmulationCreationError::Xdp(XdpEmulationCreationError::Ashpd(Response(
|
||||
ResponseError::Cancelled,
|
||||
))) => true,
|
||||
_ => false,
|
||||
}
|
||||
)))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user