Use strum(serialize_all) instead of strum(to_string)
This commit is contained in:
parent
c5db6d56ad
commit
75ea42961f
@ -9,17 +9,15 @@ use strum::{AsRefStr, Display, EnumString};
|
|||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, AsRefStr, Display, EnumString)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, AsRefStr, Display, EnumString)]
|
||||||
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
|
#[strum(serialize_all = "snake_case")]
|
||||||
pub enum DeviceKeyAlgorithm {
|
pub enum DeviceKeyAlgorithm {
|
||||||
/// The Ed25519 signature algorithm.
|
/// The Ed25519 signature algorithm.
|
||||||
#[strum(to_string = "ed25519")]
|
|
||||||
Ed25519,
|
Ed25519,
|
||||||
|
|
||||||
/// The Curve25519 ECDH algorithm.
|
/// The Curve25519 ECDH algorithm.
|
||||||
#[strum(to_string = "curve25519")]
|
|
||||||
Curve25519,
|
Curve25519,
|
||||||
|
|
||||||
/// The Curve25519 ECDH algorithm, but the key also contains signatures
|
/// The Curve25519 ECDH algorithm, but the key also contains signatures
|
||||||
#[strum(to_string = "signed_curve25519")]
|
|
||||||
SignedCurve25519,
|
SignedCurve25519,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,8 +25,8 @@ pub enum DeviceKeyAlgorithm {
|
|||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, AsRefStr, Display, EnumString)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, AsRefStr, Display, EnumString)]
|
||||||
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
|
#[strum(serialize_all = "snake_case")]
|
||||||
pub enum ServerKeyAlgorithm {
|
pub enum ServerKeyAlgorithm {
|
||||||
/// The Ed25519 signature algorithm.
|
/// The Ed25519 signature algorithm.
|
||||||
#[strum(to_string = "ed25519")]
|
|
||||||
Ed25519,
|
Ed25519,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user