diff --git a/tuta-sdk/rust/sdk/src/instance_mapper.rs b/tuta-sdk/rust/sdk/src/instance_mapper.rs index a261913c1ce..297fe048709 100644 --- a/tuta-sdk/rust/sdk/src/instance_mapper.rs +++ b/tuta-sdk/rust/sdk/src/instance_mapper.rs @@ -214,13 +214,13 @@ struct ElementValueDeserializer<'s> { value: ElementValue, } -impl<'s> ElementValueDeserializer<'s> { +impl ElementValueDeserializer<'_> { fn wrong_type_err(&self, expected: &str) -> DeError { DeError::wrong_type(self.key, &self.value, expected) } } -impl<'de, 's> Deserializer<'de> for ElementValueDeserializer<'s> { +impl<'de> Deserializer<'de> for ElementValueDeserializer<'_> { type Error = DeError; serde::forward_to_deserialize_any! { @@ -277,12 +277,12 @@ impl<'de, 's> Deserializer<'de> for ElementValueDeserializer<'s> { where V: Visitor<'de>, { - return match self.value { + match self.value { ElementValue::String(str) => visitor.visit_string(str), ElementValue::IdGeneratedId(GeneratedId(id)) | ElementValue::IdCustomId(CustomId(id)) => visitor.visit_string(id), _ => Err(self.wrong_type_err("string")), - }; + } } fn deserialize_byte_buf(self, visitor: V) -> Result @@ -432,7 +432,7 @@ impl<'de, 's> Deserializer<'de> for ElementValueDeserializer<'s> { } } -impl<'de, 's> EnumAccess<'de> for ElementValueDeserializer<'s> { +impl<'de> EnumAccess<'de> for ElementValueDeserializer<'_> { type Error = DeError; type Variant = Self; @@ -446,7 +446,7 @@ impl<'de, 's> EnumAccess<'de> for ElementValueDeserializer<'s> { } } -impl<'de, 's> VariantAccess<'de> for ElementValueDeserializer<'s> { +impl<'de> VariantAccess<'de> for ElementValueDeserializer<'_> { type Error = DeError; fn unit_variant(self) -> Result<(), Self::Error> { @@ -512,7 +512,7 @@ where } } -impl<'de, 's, I> de::SeqAccess<'de> for ArrayDeserializer<'s, I> +impl<'de, I> de::SeqAccess<'de> for ArrayDeserializer<'_, I> where I: Iterator, { diff --git a/tuta-sdk/rust/sdk/src/services/generator.rs b/tuta-sdk/rust/sdk/src/services/generator.rs index 54362506d9b..b09b3f52a7d 100644 --- a/tuta-sdk/rust/sdk/src/services/generator.rs +++ b/tuta-sdk/rust/sdk/src/services/generator.rs @@ -66,15 +66,14 @@ macro_rules! __service_handle_response { /// // but respond with `NewsOut` /// service_impl!(GET, NewsService, (), NewsOut); /// ``` - -// we don't want to generate the rust code for services from the JS directly because it's harder to maintain and -// largely unreadable. -// -// since services can either take an arg or not and return something or not, we need a trampoline implementation -// for each service that can decode and return the response or just return Ok(()) immediately after receiving a 200. -// this trampoline is implemented in the last branch below. #[macro_export] macro_rules! service_impl { + // we don't want to generate the rust code for services from the JS directly because it's harder to maintain and + // largely unreadable. + // + // since services can either take an arg or not and return something or not, we need a trampoline implementation + // for each service that can decode and return the response or just return Ok(()) immediately after receiving a 200. + // this trampoline is implemented in the last branch below. (declare, $service_name: ty, $service_path: expr, $service_version: expr) => { // mark the type as Service // This implementation is required to be able to implement any HTTP method