-
Provide a
Serializer
impl that can write primitives and unit variants to a&mut fmt::Formatter
(#1705, thanks @jethrogb)use serde::Serialize; use std::fmt::{self, Display}; #[derive(Serialize)] #[serde(rename_all = "kebab-case")] pub enum MessageType { StartRequest, EndRequest, } impl Display for MessageType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.serialize(f) } }