From 5e7cae746a4ce1fb2dea460853665a1602d62415 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 10 Aug 2024 23:46:37 +0200 Subject: [PATCH] desktop/request: Relax trait conditions on Response Make it usable in backend side without unnecessarily implement Serialize when not needed --- src/desktop/request.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/desktop/request.rs b/src/desktop/request.rs index 09d746724..c4fd8ae8e 100644 --- a/src/desktop/request.rs +++ b/src/desktop/request.rs @@ -22,10 +22,7 @@ use crate::{desktop::HandleToken, proxy::Proxy, Error}; /// of a [`Request`]. #[derive(Debug, Type)] #[zvariant(signature = "(ua{sv})")] -pub enum Response -where - T: for<'de> Deserialize<'de> + Type, -{ +pub enum Response { /// Success, the request is carried out. Ok(T), /// The user cancelled the request or something else happened. @@ -33,10 +30,7 @@ where } #[cfg(feature = "backend")] -impl Response -where - T: for<'de> Deserialize<'de> + Type, -{ +impl Response { /// The corresponding response type. pub fn response_type(self) -> ResponseType { match self { @@ -113,7 +107,7 @@ where impl Serialize for Response where - T: for<'de> Deserialize<'de> + Serialize + Type, + T: Serialize + Type, { fn serialize(&self, serializer: S) -> Result where @@ -135,10 +129,7 @@ where } #[doc(hidden)] -impl From<(ResponseType, Option)> for Response -where - T: for<'de> Deserialize<'de> + Type, -{ +impl From<(ResponseType, Option)> for Response { fn from(f: (ResponseType, Option)) -> Self { match f.0 { ResponseType::Success => {