Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. enum Shape {
  2. Rectangle,
  3. Square,
  4. }
  5.  
  6. struct Quadrilateral<T> {
  7. width: T,
  8. height: T,
  9. shape: Shape,
  10. }
  11.  
  12. fn main(){
  13. // Instanciamos un struct Quadrilateral
  14. let rectangle_one = Quadrilateral{width: 200, height: 200, shape: Shape::Rectangle};
  15. let rectangle_two = Quadrilateral{width: -100, height: -200, shape: Shape::Square };
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement