-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweak example in chapter 10 #2363
Conversation
We were cheating due to Copy, and that made this example awkward. Returning a reference is probably better here anyway, and it makes everything flow a bit nicer. Fixes #1761
Update books ## nomicon 3 commits in d1517d4e3f29264c5c67bce2658516bb5202c800..bfe1ab96d717d1dda50e499b360f2e2f57e1750a 2020-05-12 13:47:00 -0400 to 2020-06-05 13:19:42 -0400 - Clarify that str data must still be initialized - Remove language-level UB for non-UTF-8 str - fix Nomicon transmute UB ## reference 5 commits in becdca9477c9eafa96a4eea5156fe7a2730d9dd2..5d40ba5c2515caffa7790cda621239dc21ef5a72 2020-05-21 21:08:02 +0100 to 2020-06-06 20:25:36 -0700 - Add some links to Disambiguating Function Calls. (rust-lang/reference#829) - change bash to sh as shell code blocks language indentifier (rust-lang/reference#827) - Fix sentence mistake in array-expr.md (rust-lang/reference#826) - removed the word "Second" form the beginning of the 2nd list item and labelled it as `2` (rust-lang/reference#822) - Update fn-like proc-macro invocation restrictions. (rust-lang/reference#816) ## book 14 commits in e8a4714a9d8a6136a59b8e63544e149683876e36..30cd9dfe71c446de63826bb4472627af45acc9db 2020-05-25 10:29:27 -0500 to 2020-06-07 23:07:19 -0500 - Unnecessarily long type name in Ch 13 (rust-lang/book#2362) - Tweak example in chapter 10 (rust-lang/book#2363) - Mention that to_lowercase isn't perfect (rust-lang/book#2364) - fix typo in CONTRIBUTING.md (rust-lang/book#2360) - Link German translation in appendix F (rust-lang/book#2347) - Updates wording on Box example (rust-lang/book#2332) - fix: match 15-24 with 15-18 (rust-lang/book#2324) - Reword ch01-03 recap paragraph (rust-lang/book#2305) - Remove some confusing wording. (rust-lang/book#2358) - Clarify some wording a bit (rust-lang/book#2357) - Update ch12-05 PowerShell note (rust-lang/book#2348) - text -> console (rust-lang/book#2352) - Improve wording around drop (rust-lang/book#2350) - Make some statements about crates more correct (rust-lang/book#2349) ## edition-guide 1 commits in 0a8ab5046829733eb03df0738c4fafaa9b36b348..82bec5877c77cfad530ca11095db4456d757f668 2020-05-18 08:34:23 -0500 to 2020-06-03 08:56:02 -0500 - Add stuff for Rust 1.33 (rust-lang/edition-guide#214)
The changes merged in this PR seem to have affected the continuity of this example into Chapter 10.2. None of the error codes associated with these two line up and the borrowing flips throughout the two chapters without rewriting the example code. Chapter 10.2
Chapter 10.1
Written error
Actual error
It seems like there was a PR that fixed most of the issues with Chapter 10.1 by adding
(https://doc.rust-lang.org/book/ch10-02-traits.html#fixing-the-largest-function-with-trait-bounds) listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/src/main.rs src/ch10-01-syntax.md |
Can you open a new issue for this please? |
We were cheating due to Copy, and that made this example awkward.
Returning a reference is probably better here anyway, and it makes
everything flow a bit nicer.
FIxes #1761