From 9384d24d04c913fe8c41d852658ccd8371f60033 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sat, 8 Aug 2020 17:06:14 +0200 Subject: [PATCH] Fix last commit not building with the unstable-pre-spec feature --- ruma-client-api/src/r0/keys.rs | 9 ++++----- ruma-client-api/src/r0/keys/get_keys.rs | 8 +++++--- ruma-client-api/src/r0/keys/upload_signing_keys.rs | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ruma-client-api/src/r0/keys.rs b/ruma-client-api/src/r0/keys.rs index d1756f89..288d2ed9 100644 --- a/ruma-client-api/src/r0/keys.rs +++ b/ruma-client-api/src/r0/keys.rs @@ -2,7 +2,6 @@ use std::{collections::BTreeMap, fmt::Debug}; -use ruma_api::Outgoing; use ruma_events::Algorithm; use ruma_identifiers::{DeviceId, DeviceKeyId, UserId}; use serde::{Deserialize, Serialize}; @@ -70,13 +69,13 @@ pub enum OneTimeKey { } /// A cross signing key. -#[derive(Clone, Debug, Outgoing, Serialize)] -pub struct CrossSigningKey<'a> { +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct CrossSigningKey { /// The ID of the user the key belongs to. - pub user_id: &'a UserId, + pub user_id: UserId, /// What the key is used for. - pub usage: &'a [KeyUsage], + pub usage: Vec, /// The public key. The object must have exactly one property. pub keys: BTreeMap, diff --git a/ruma-client-api/src/r0/keys/get_keys.rs b/ruma-client-api/src/r0/keys/get_keys.rs index ad18eea4..c93b69b7 100644 --- a/ruma-client-api/src/r0/keys/get_keys.rs +++ b/ruma-client-api/src/r0/keys/get_keys.rs @@ -6,6 +6,8 @@ use ruma_api::ruma_api; use ruma_identifiers::{DeviceId, UserId}; use serde_json::Value as JsonValue; +#[cfg(feature = "unstable-pre-spec")] +use super::CrossSigningKey; use super::DeviceKeys; ruma_api! { @@ -55,17 +57,17 @@ ruma_api! { /// Information on the master cross-signing keys of the queried users. #[cfg(feature = "unstable-pre-spec")] #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] - pub master_keys: BTreeMap, + pub master_keys: BTreeMap, /// Information on the self-signing keys of the queried users. #[cfg(feature = "unstable-pre-spec")] #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] - pub self_signing_keys: BTreeMap, + pub self_signing_keys: BTreeMap, /// Information on the user-signing keys of the queried users. #[cfg(feature = "unstable-pre-spec")] #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] - pub user_signing_keys: BTreeMap, + pub user_signing_keys: BTreeMap, } error: crate::Error diff --git a/ruma-client-api/src/r0/keys/upload_signing_keys.rs b/ruma-client-api/src/r0/keys/upload_signing_keys.rs index 981f1ee9..1f832ab8 100644 --- a/ruma-client-api/src/r0/keys/upload_signing_keys.rs +++ b/ruma-client-api/src/r0/keys/upload_signing_keys.rs @@ -22,17 +22,17 @@ ruma_api! { /// The user's master key. #[serde(skip_serializing_if = "Option::is_none")] - pub master_key: Option>, + pub master_key: Option, /// The user's self-signing key. Must be signed with the accompanied master, or by the /// user's most recently uploaded master key if no master key is included in the request. #[serde(skip_serializing_if = "Option::is_none")] - pub self_signing_key: Option>, + pub self_signing_key: Option, /// The user's user-signing key. Must be signed with the accompanied master, or by the /// user's most recently uploaded master key if no master key is included in the request. #[serde(skip_serializing_if = "Option::is_none")] - pub user_signing_key: Option>, + pub user_signing_key: Option, } response: {}