Skip to content

Instantly share code, notes, and snippets.

@tecywiz121
Created January 24, 2018 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tecywiz121/edccdc276633391bc5281e10754777ed to your computer and use it in GitHub Desktop.
Save tecywiz121/edccdc276633391bc5281e10754777ed to your computer and use it in GitHub Desktop.
How do I
#[derive(Deserialize)]
struct Demo {
d1: Demo<i32>,
d2: Demo<String>,
d3: Demo<String>,
}
enum DemoEnum<T> {
A,
B,
C(T),
}
d1 = "A" # DemoEnum::A
d2 = "B" # DemoEnum::B
d3 = "hello" # DemoEnum::C("hello")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment