fix clippy warnings

This commit is contained in:
Ferdinand Schober
2024-07-12 17:13:10 +02:00
parent e063f4ffb4
commit 740272e9a5
3 changed files with 14 additions and 16 deletions

View File

@@ -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
)))
)
}
}

View File

@@ -290,8 +290,7 @@ async fn do_capture<'a>(
&mut active_clients,
&mut next_barrier_id,
&notify_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));

View File

@@ -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,
}
)))
)
}
}