Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Shape {
- Rectangle,
- Square,
- }
- struct Quadrilateral<T> {
- width: T,
- height: T,
- shape: Shape,
- }
- fn main(){
- // Instanciamos un struct Quadrilateral
- let rectangle_one = Quadrilateral{width: 200, height: 200, shape: Shape::Rectangle};
- let rectangle_two = Quadrilateral{width: -100, height: -200, shape: Shape::Square };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement