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

View File

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

View File

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