fix conditional compilation

This commit is contained in:
Ferdinand Schober
2024-07-30 10:52:56 +02:00
parent 127c3366bf
commit 0e2c749b29

View File

@@ -87,19 +87,25 @@ pub enum EmulationCreationError {
impl EmulationCreationError { impl EmulationCreationError {
/// request was intentionally denied by the user /// request was intentionally denied by the user
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
pub(crate) fn cancelled_by_user(&self) -> bool { pub(crate) fn cancelled_by_user(&self) -> bool {
matches!( #[cfg(feature = "libei")]
if matches!(
self, self,
EmulationCreationError::Libei(LibeiEmulationCreationError::Ashpd(Response( EmulationCreationError::Libei(LibeiEmulationCreationError::Ashpd(Response(
ResponseError::Cancelled, ResponseError::Cancelled,
))) | EmulationCreationError::Xdp(XdpEmulationCreationError::Ashpd(Response( )))
) {
return true;
}
#[cfg(feature = "xdg_desktop_portal")]
if matches!(
self,
EmulationCreationError::Xdp(XdpEmulationCreationError::Ashpd(Response(
ResponseError::Cancelled, ResponseError::Cancelled,
))) )))
) ) {
} return true;
#[cfg(not(all(unix, feature = "libei", not(target_os = "macos"))))] }
pub(crate) fn cancelled_by_user(&self) -> bool {
false false
} }
} }