Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- pub enum GizmoType {
- Foo,
- Bar
- }
- #[derive(Debug)]
- pub struct Gizmo
- {
- ty: GizmoType
- }
- pub type Widget = Gizmo;
- pub type WidgetType = GizmoType; // Option 1, doesn't work!
- //use GizmoType as WidgetType; // Option 2, works!
- fn main() {
- let widget = Widget {
- ty: WidgetType::Foo
- };
- println!("Widget: {:?}", widget);
- }
Add Comment
Please, Sign In to add comment