File tree Expand file tree Collapse file tree 8 files changed +22
-18
lines changed Expand file tree Collapse file tree 8 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -68,5 +68,5 @@ mod tests {
68
68
// `Err(something)`. This pattern is very common in Rust, though, so there's
69
69
// a `?` operator that does pretty much what you would make that match statement
70
70
// do for you! Take a look at this section of the Error Handling chapter:
71
- // https://doc.rust-lang.org/book/second-edition/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-
71
+ // https://doc.rust-lang.org/stable/ book/second-edition/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator
72
72
// and give it a try!
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ impl error::Error for CreationError {
124
124
// can be returned from the same function because all errors act the same
125
125
// since they all implement the `error::Error` trait.
126
126
// Check out this section of the book:
127
- // https://doc.rust-lang.org/stable/book/second-edition/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-
127
+ // https://doc.rust-lang.org/stable/book/second-edition/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator
128
128
129
129
// Another another hint: Note that because the `?` operator returns
130
130
// the *unwrapped* value in the `Ok` case, if we want to return a `Result` from
Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ fn main() {
39
39
40
40
41
41
// There's a shorthand to initialize Arrays with a certain size that does not
42
- // require you to type in 100 items (but you certainly can if you want!)
43
- // Check out the Primitive Types -> Arrays section of the book:
44
- // https://doc.rust-lang.org/stable/book/second-edition/ch03-02-data-types.html#arrays
42
+ // require you to type in 100 items (but you certainly can if you want!).
43
+ // For example, you can do:
44
+ // let array = ["Are we there yet?"; 10];
45
+
45
46
// Bonus: what are some other things you could have that would return true
46
47
// for `a.len() >= 100`?
Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ fn main() {
38
38
39
39
40
40
41
- // Take a look at the Primitive Types -> Slices section of the book:
42
- // http ://doc.rust-lang.org/stable/book/primitive-types .html#slices
41
+ // Take a look at the Understanding Ownership -> Slices -> Other Slices section of the book:
42
+ // https ://doc.rust-lang.org/stable/book/second-edition/ch04-03-slices .html#other- slices
43
43
// and use the starting and ending indices of the items in the Array
44
44
// that you want to end up in the slice.
45
45
46
46
// If you're curious why the right hand of the `==` comparison does not
47
47
// have an ampersand for a reference since the left hand side is a
48
- // reference, take a look at the Deref coercions chapter :
49
- // http ://doc.rust-lang.org/stable/book/deref-coercions .html
48
+ // reference, take a look at the Deref coercions section of the book :
49
+ // https ://doc.rust-lang.org/stable/book/second-edition/ch15-02-deref .html#implicit-deref-coercions-with-functions-and-methods
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ fn main() {
38
38
39
39
40
40
41
- // Take a look at the Primitive Types -> Tuples section of the book:
42
- // http ://doc.rust-lang.org/stable/book/primitive- types.html#tuples
43
- // Particularly the part about " destructuring lets". You'll need to
44
- // make a pattern to bind `name` and `age` to the appropriate parts
41
+ // Take a look at the Data Types -> The Tuple Type section of the book:
42
+ // https ://doc.rust-lang.org/stable/book/second-edition/ch03-02-data- types.html#the-tuple-type
43
+ // Particularly the part about destructuring (second to last example in the section).
44
+ // You'll need to make a pattern to bind `name` and `age` to the appropriate parts
45
45
// of the tuple. You can do it!!
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ fn main() {
39
39
40
40
41
41
// While you could use a destructuring `let` for the tuple here, try
42
- // indexing into it instead, as explained here:
43
- // http://doc.rust-lang.org/stable/book/primitive-types.html#tuple-indexing
42
+ // indexing into it instead, as explained in the last example of the
43
+ // Data Types -> The Tuple Type section of the book:
44
+ // https://doc.rust-lang.org/stable/book/second-edition/ch03-02-data-types.html#the-tuple-type
44
45
// Now you have another tool in your toolbox!
Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ mod tests {
114
114
115
115
116
116
117
- // Minor hint: In each of the two cases in the match in main, you can create x with either a 'turbofish' or by hinting the type of x to the compiler. You may try both.
117
+ // Minor hint: In each of the two cases in the match in main, you can create x with either
118
+ // a 'turbofish' or by hinting the type of x to the compiler. You may try both.
118
119
119
120
120
121
@@ -142,4 +143,5 @@ mod tests {
142
143
143
144
144
145
145
- // Major hint: Have a look at the Iter trait and at the explanation of its collect function. Especially the part about Result is interesting.
146
+ // Major hint: Have a look at the Iter trait and at the explanation of its collect function.
147
+ // Especially the part about Result is interesting.
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ fn main() {
45
45
// to **immutable** data. But we want to *change* the number of `jobs_completed`
46
46
// so we'll need to also use another type that will only allow one thread to
47
47
// mutate the data at a time. Take a look at this section of the book:
48
- // https://doc.rust-lang.org/stable/book/concurrency .html#safe-shared-mutable-state
48
+ // https://doc.rust-lang.org/stable/book/second-edition/ch16-03-shared-state .html#atomic-reference-counting-with-arct
49
49
// and keep scrolling if you'd like more hints :)
50
50
51
51
You can’t perform that action at this time.
0 commit comments