Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use serde::{Deserialize,Serialize};
- #[derive(Deserialize,Serialize)]
- // #[serde(tag = "type")]
- #[serde(tag = "type", content = "content")]
- pub enum Colors {
- Red = 0,
- Blue,
- }
- fn main() {
- println!("{}", serde_json::to_string(&Colors::Red).unwrap());
- println!("{}", serde_json::to_string(&Colors::Blue).unwrap());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement