From 55c1dd5ca792b16bb01e79261c6fd5c6f88cc610 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 2 Dec 2020 14:18:21 +0100 Subject: [PATCH] identifiers: Feature-gate serde test under serde feature --- ruma-identifiers/src/crypto_algorithms.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ruma-identifiers/src/crypto_algorithms.rs b/ruma-identifiers/src/crypto_algorithms.rs index 75644815..f561df47 100644 --- a/ruma-identifiers/src/crypto_algorithms.rs +++ b/ruma-identifiers/src/crypto_algorithms.rs @@ -137,10 +137,7 @@ impl From for String { #[cfg(test)] mod tests { - use ruma_serde::test::serde_json_eq; - use serde_json::json; - - use super::{DeviceKeyAlgorithm, EventEncryptionAlgorithm, SigningKeyAlgorithm}; + use super::{DeviceKeyAlgorithm, SigningKeyAlgorithm}; #[test] fn parse_device_key_algorithm() { @@ -155,7 +152,13 @@ mod tests { } #[test] + #[cfg(feature = "serde")] fn event_encryption_algorithm_serde() { + use ruma_serde::test::serde_json_eq; + use serde_json::json; + + use super::EventEncryptionAlgorithm; + serde_json_eq(EventEncryptionAlgorithm::MegolmV1AesSha2, json!("m.megolm.v1.aes-sha2")); serde_json_eq( EventEncryptionAlgorithm::OlmV1Curve25519AesSha2,