Page 110 (loop labels), where the code is truncated but one could think it's just
Page 114 ("Looping through a collection like this is a bad idea. Give 2 reasons why.") only shows the first part of the detailed explanation ("error prone") and not the 2nd ("slow").
Page 116 ("What is a better and more concise alternative to loop over the array?"), missing the last sentence ("The safety and conciseness of for loops ...")
Page 128 ("What happens in terms of the heap and stack when we assign s1 to s2 in line 2?") only show part of the "s1" variable and nothing of "s2" or the heap.
We can use curly brackets to create a new scope, allowing for multiple mutable references, just not simultaneous ones:
fnmain(){letmut s:String = String::from("Hello");{let r1:&mutString = &mut s;// r1 goes out of scope here,}// So we can make a new reference with no problemslet r2:&mutString = &mut s;}
PDF page 180 ("What's a possible error inducing operation on string slice range indices?"), I'm not sure what the first_word function is supposed to be:
It returns a usize, not a slice, even though that area of the deck is about slices,
If it's supposed to show a problem with slicing in between UTF-8 character, b' ' is a single byte character, so it's valid to slice at that boundary (it would be invalid if item was in the range 0x80-0xBF, i.e. of the form 0x10xxxxxx)
If it's the beginning of the page 181 question, then it's at the wrong place (but then also see next point of this issue)
page 181/182:
It mentions a first_word function, but if the function from page 180, then see point 1 above, which does compile since word is then the usize 5, and not a reference to the "hello" slice.