From 21d3d75172c74dfc1d8453642230197a6c697eaa Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 3 Nov 2021 18:31:38 +0100 Subject: [PATCH] client-api: Fix up previous botched PRs --- crates/ruma-client-api/src/r0/uiaa.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/ruma-client-api/src/r0/uiaa.rs b/crates/ruma-client-api/src/r0/uiaa.rs index e5c408cd..006ca1fb 100644 --- a/crates/ruma-client-api/src/r0/uiaa.rs +++ b/crates/ruma-client-api/src/r0/uiaa.rs @@ -523,7 +523,7 @@ impl IncomingOAuth2 { #[serde(tag = "type", rename = "m.login.email.identity")] pub struct EmailIdentity<'a> { /// Thirdparty identifier credentials. - #[cfg_attr(rename = "threepidCreds")] + #[serde(rename = "threepidCreds")] #[cfg_attr( feature = "compat", serde(alias = "threepid_creds", deserialize_with = "deserialize_thirdparty_id_creds") @@ -554,7 +554,7 @@ impl IncomingEmailIdentity { #[serde(tag = "type", rename = "m.login.msisdn")] pub struct Msisdn<'a> { /// Thirdparty identifier credentials. - #[cfg_attr(rename = "threepidCreds")] + #[serde(rename = "threepidCreds")] #[cfg_attr( feature = "compat", serde(alias = "threepid_creds", deserialize_with = "deserialize_thirdparty_id_creds") @@ -861,7 +861,9 @@ impl OutgoingResponse for UiaaResponse { } } -fn deserialize_thirdparty_id_creds<'de, D>(deserializer: D) -> Vec +fn deserialize_thirdparty_id_creds<'de, D>( + deserializer: D, +) -> Result, D::Error> where D: Deserializer<'de>, { @@ -891,4 +893,6 @@ where Ok(vec![creds]) } } + + deserializer.deserialize_any(CredsVisitor) }