Add some notes to Liz

This commit is contained in:
Carol (Nichols || Goulding)
2016-09-23 15:34:00 -04:00
parent 0203adfaea
commit c274db25c4
+7
View File
@@ -134,11 +134,16 @@ fn area(dimensions: (u32, u32)) -> u32 {
}
```
<!-- I will add ghosting & wingdings once we're in libreoffice /Carol -->
In one way, this is a little better. Tuples let us add a bit of structure, and
we’re now passing just one argument. But in another way this method less clear:
tuples don’t give names to their elements, so our calculation has gotten more
confusing because we have to index into the parts of the tuple:
<!-- I will change this to use wingdings instead of repeating this code once
we're in libreoffice /Carol -->
```rust,ignore
dimensions.0 * dimensions.1
```
@@ -178,6 +183,8 @@ fn area(rectangle: &Rectangle) -> u32 {
}
```
<!-- Will add ghosting & wingdings once we're in libreoffice /Carol -->
Here we've defined a `struct` and given it the name `Rectangle`. Inside the
`{}` we defined the fields to be `length` and `width`, both of which have type
`u32`. Then in `main`, we create a particular instance of a `Rectangle` that