update old book references to the second edition of the book
This commit is contained in:
@@ -39,8 +39,9 @@ fn main() {
|
||||
|
||||
|
||||
// There's a shorthand to initialize Arrays with a certain size that does not
|
||||
// require you to type in 100 items (but you certainly can if you want!)
|
||||
// Check out the Primitive Types -> Arrays section of the book:
|
||||
// https://doc.rust-lang.org/stable/book/second-edition/ch03-02-data-types.html#arrays
|
||||
// require you to type in 100 items (but you certainly can if you want!).
|
||||
// For example, you can do:
|
||||
// let array = ["Are we there yet?"; 10];
|
||||
|
||||
// Bonus: what are some other things you could have that would return true
|
||||
// for `a.len() >= 100`?
|
||||
|
||||
@@ -38,12 +38,12 @@ fn main() {
|
||||
|
||||
|
||||
|
||||
// Take a look at the Primitive Types -> Slices section of the book:
|
||||
// http://doc.rust-lang.org/stable/book/primitive-types.html#slices
|
||||
// Take a look at the Understanding Ownership -> Slices -> Other Slices section of the book:
|
||||
// https://doc.rust-lang.org/stable/book/second-edition/ch04-03-slices.html#other-slices
|
||||
// and use the starting and ending indices of the items in the Array
|
||||
// that you want to end up in the slice.
|
||||
|
||||
// If you're curious why the right hand of the `==` comparison does not
|
||||
// have an ampersand for a reference since the left hand side is a
|
||||
// reference, take a look at the Deref coercions chapter:
|
||||
// http://doc.rust-lang.org/stable/book/deref-coercions.html
|
||||
// reference, take a look at the Deref coercions section of the book:
|
||||
// https://doc.rust-lang.org/stable/book/second-edition/ch15-02-deref.html#implicit-deref-coercions-with-functions-and-methods
|
||||
|
||||
@@ -38,8 +38,8 @@ fn main() {
|
||||
|
||||
|
||||
|
||||
// Take a look at the Primitive Types -> Tuples section of the book:
|
||||
// http://doc.rust-lang.org/stable/book/primitive-types.html#tuples
|
||||
// Particularly the part about "destructuring lets". You'll need to
|
||||
// make a pattern to bind `name` and `age` to the appropriate parts
|
||||
// Take a look at the Data Types -> The Tuple Type section of the book:
|
||||
// https://doc.rust-lang.org/stable/book/second-edition/ch03-02-data-types.html#the-tuple-type
|
||||
// Particularly the part about destructuring (second to last example in the section).
|
||||
// You'll need to make a pattern to bind `name` and `age` to the appropriate parts
|
||||
// of the tuple. You can do it!!
|
||||
|
||||
@@ -39,6 +39,7 @@ fn main() {
|
||||
|
||||
|
||||
// While you could use a destructuring `let` for the tuple here, try
|
||||
// indexing into it instead, as explained here:
|
||||
// http://doc.rust-lang.org/stable/book/primitive-types.html#tuple-indexing
|
||||
// indexing into it instead, as explained in the last example of the
|
||||
// Data Types -> The Tuple Type section of the book:
|
||||
// https://doc.rust-lang.org/stable/book/second-edition/ch03-02-data-types.html#the-tuple-type
|
||||
// Now you have another tool in your toolbox!
|
||||
|
||||
Reference in New Issue
Block a user