Update the books

This commit is contained in:
Blaine Bublitz 2020-05-10 21:39:43 -07:00
parent b7bc7fea12
commit 475754d9d9
4 changed files with 24 additions and 12 deletions

View File

@ -44,5 +44,8 @@ impl Square {
field(name = "area", type = "f32"), field(name = "area", type = "f32"),
field(name = "scale", type = "Shape", arg(name = "s", type = "f32")) field(name = "scale", type = "Shape", arg(name = "s", type = "f32"))
)] )]
struct Shape(Circle, Square); enum Shape {
Circle(Circle),
Square(Square),
}
``` ```

View File

@ -40,5 +40,8 @@ impl Square {
} }
#[Union] #[Union]
struct Shape(Circle, Square); enum Shape {
Circle(Circle),
Square(Square),
}
``` ```

View File

@ -41,5 +41,8 @@ impl Square {
field(name = "area", type = "f32"), field(name = "area", type = "f32"),
field(name = "scale", type = "Shape", arg(name = "s", type = "f32")) field(name = "scale", type = "Shape", arg(name = "s", type = "f32"))
)] )]
struct Shape(Circle, Square); enum Shape {
Circle(Circle),
Square(Square),
}
``` ```

View File

@ -38,5 +38,8 @@ impl Square {
} }
#[Union] #[Union]
struct Shape(Circle, Square); enum Shape {
Circle(Circle),
Square(Square),
}
``` ```