You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem:
The answer for the question says
For haystack, the slice type &[String] can accept more inputs than &Vec<String>, so it is preferred.
IMO this statement comes "out of the void" i.e. without a satisfying reasoning. A (short) explanation why &[String] can accept more inputs than &Vec<String> would be really helpful. In case that I've missing something in the main part of the book a reference to the accordingly chapter would be sufficient.
Suggested fix:
Adding an explanation or a reference to the accordingly chapter
The text was updated successfully, but these errors were encountered:
Adding on to this (as was going through the book to make sure I was solid on the basics with tests), I don't believe the suggested answer is valid as is either, as it needs lifetime annotations - would end up looking like
main
branch to see if this has already been fixed, in this file:URL to the section(s) of the book with this problem:
https://rust-book.cs.brown.edu/ch04-05-ownership-recap.html
Description of the problem:
The answer for the question says
IMO this statement comes "out of the void" i.e. without a satisfying reasoning. A (short) explanation why &[String] can accept more inputs than &Vec<String> would be really helpful. In case that I've missing something in the main part of the book a reference to the accordingly chapter would be sufficient.
Suggested fix:
Adding an explanation or a reference to the accordingly chapter
The text was updated successfully, but these errors were encountered: