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