From 75ea42961fd3c1dcf57ea90bac7a64570900ea32 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 23 Jun 2020 12:52:21 +0200 Subject: [PATCH] Use strum(serialize_all) instead of strum(to_string) --- ruma-identifiers/src/key_algorithms.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ruma-identifiers/src/key_algorithms.rs b/ruma-identifiers/src/key_algorithms.rs index 3b489f2a..a96fe6e2 100644 --- a/ruma-identifiers/src/key_algorithms.rs +++ b/ruma-identifiers/src/key_algorithms.rs @@ -9,17 +9,15 @@ use strum::{AsRefStr, Display, EnumString}; #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, AsRefStr, Display, EnumString)] #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] #[non_exhaustive] +#[strum(serialize_all = "snake_case")] pub enum DeviceKeyAlgorithm { /// The Ed25519 signature algorithm. - #[strum(to_string = "ed25519")] Ed25519, /// The Curve25519 ECDH algorithm. - #[strum(to_string = "curve25519")] Curve25519, /// The Curve25519 ECDH algorithm, but the key also contains signatures - #[strum(to_string = "signed_curve25519")] SignedCurve25519, } @@ -27,8 +25,8 @@ pub enum DeviceKeyAlgorithm { #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, AsRefStr, Display, EnumString)] #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] #[non_exhaustive] +#[strum(serialize_all = "snake_case")] pub enum ServerKeyAlgorithm { /// The Ed25519 signature algorithm. - #[strum(to_string = "ed25519")] Ed25519, }