1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-17 15:21:32 +02:00
Commit Graph

645 Commits

Author SHA1 Message Date
Andrew Walbran
20e83166f4 Mention alloc too 2023-01-23 12:44:07 +00:00
Igor Petruk
567a570d59 Update std.md
Addition a mention of existence of `core` Standard Library.
2023-01-23 12:44:07 +00:00
Igor Petruk
66509f2f3e
Update for-expressions.md (#238)
If we are introducing `for` loops, I think it is beneficial to show a very basic `for i=0; i < 10; i+=2` too.
2023-01-23 12:04:42 +00:00
Igor Petruk
581f5a4008
Update blocks.md (#235)
Adding the important note about ";" in blocks.
2023-01-23 12:03:06 +00:00
Charisee Chiw
56757566b3
Speaker notes for enums.md (#199)
* Update enums.md

* Update enums.md
2023-01-23 11:58:49 +00:00
Charisee Chiw
be2bb2d4c5
Speaker notes for Method example (#203)
* Speaker notes for Method example

* Update example.md
2023-01-23 11:53:33 +00:00
Igor Petruk
94ed176761
Update destructuring-enums.md (#231) 2023-01-23 11:40:02 +00:00
Igor Petruk
ef119bc0d3
Update receiver.md (#229)
The key takeaway is mutability of receivers and the rules that come with it. It might be a repetition of borrow checker rules, but it is important to know they apply to `self` as to any other variable or argument.
2023-01-23 11:39:38 +00:00
Igor Petruk
c109dabf5f
Update tuple-structs.md (#226)
* Update tuple-structs.md

I am adding more information about newtypes. The speaker can get questions about it or may wish to encourage this great pattern.

* Fix typos and explanation

Co-authored-by: Andrew Walbran <qwandor@google.com>
2023-01-23 11:38:37 +00:00
Igor Petruk
d1588e4f2f
Update scopes-shadowing.md (#216)
Adding the definition of what shadowing is and how it is different from mutation.
2023-01-23 11:38:11 +00:00
Igor Petruk
71ce061cc2
Update lifetimes-data-structures.md (#224)
* Update lifetimes-data-structures.md

The example is quite simple, but in it's simplicity it may raise the question why do we even need lifetimes in the structs? Isn't it obvious that the referenced value should always outlive the struct? This sentence tries to explain that more complex cases exist.

* Fix typo

Co-authored-by: Andrew Walbran <qwandor@google.com>
2023-01-23 11:37:38 +00:00
Igor Petruk
473fd02be7
Update sizes.md (#228)
Adding more details in how to control Rust enum size and discriminant values.
2023-01-23 11:33:23 +00:00
Igor Petruk
8dd749da60
Update field-shorthand.md (#227)
Introducing `Self` type that students can encounter in many places and nice to use. It is only mentioned later in the course, but it is not defined currently.
2023-01-23 11:32:46 +00:00
Igor Petruk
356d1cec19
Update boot-library.md (#225)
Adding a link to the Solution.
2023-01-23 11:30:52 +00:00
Igor Petruk
820453ba08
Update structs.md (#232)
Extending a struct example that demonstrates how to change values and how to partially copy structs.
2023-01-23 11:26:22 +00:00
Igor Petruk
4c052d33c8
Update borrowing.md (#222) 2023-01-23 11:24:17 +00:00
Igor Petruk
de4aa3de88
Update moves-function-calls.md (#220)
Additional note helps to understand what move really means. The `name` ownership went fully into the `say_hello`.
2023-01-23 11:23:44 +00:00
Igor Petruk
8c58253217
Update the Speaker Notes of the type-inference.md (#214)
* Update the Speaker Notes of the type-inference.md

I think this is one of the critical moments in understanding Rust. This behavior is different from many static and dynamic programming languages.

* Fix typo

Co-authored-by: Andrew Walbran <qwandor@google.com>
2023-01-23 11:05:46 +00:00
Igor Petruk
ec7125da2e
Adding a link to Solutions from for-loops.md and extending the answer to the bonus questions. (#213)
* Update for-loops.md

* Update solutions-morning.md
2023-01-23 11:05:36 +00:00
Igor Petruk
4760295030
Update Speaker Notes for compound-types.md (#207)
It could be a "gotcha" moment for readers when they associate `()` with `void` from, say, C++.
2023-01-23 11:04:38 +00:00
Igor Petruk
dc894b1e9d
Update arc.md (#255)
Adding more information about `Arc`: what it stands for, costs and that reference cycles can occur.
2023-01-23 10:57:10 +00:00
Igor Petruk
8107a0ea2b
Update scoped-threads.md (#253)
Adding speaker notes explaining why scoped threads work and what borrowing rules apply.
2023-01-23 10:56:32 +00:00
Igor Petruk
77a60d4101
Update send-sync.md (#258)
Adding notes that these traits are not to be implemented directly. Yet they are still to be used as normal traits in generic constraints.
2023-01-23 08:51:41 +01:00
Igor Petruk
905d0a067e
Update implicit-conversions.md (#210)
I suggest to clarify that you only need to implement `From` and nobody really implements `Into` as soon as `From` is implemented.

I decided to add a separate paragraph after the `i8` and `i16` example, as they provide intuitive understanding of reverse relationship between `From` and `Into`. Alternatively trying to explain `From` and `Into` in generic way sounds more confusing than just adding this sentence after the specific example.
2023-01-21 14:20:14 +00:00
Igor Petruk
25a32abef7
Update Speaker Notes for compile-time.md (#205)
* Update Speaker Notes for compile-time.md

The definition of memory leaks is indeed blurry, so it is important not have right expectations about this particular kind of error.

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-21 15:13:51 +01:00
Igor Petruk
79decc5540
Update Speaker Notes for what-is-rust.md (#204) 2023-01-21 14:10:00 +00:00
Charisee Chiw
d4c0099781
Added speaker notes to enum sizes (#201)
* Added speaker notes to enum sizes

* Update sizes.md

Just formatting

Co-authored-by: Fabian Bornhofen <fbornhofen@google.com>
2023-01-20 22:55:30 +01:00
Andy George
492037641e
fix Cargo.toml syntax (#190) 2023-01-20 11:28:38 +01:00
Robin Stringer
2d4340f3eb
Speaker notes for 6.5 Functions
Adds speaker notes covering functions basics (declaration parameters, return values, the 'unit' type.
2023-01-19 12:16:43 +00:00
Marko Zagar
6bda89f34e Clarification on references 2023-01-19 10:51:35 +00:00
Marko Zagar
529d4bf20c Speaker note tweaks for compound types 2023-01-19 10:51:35 +00:00
Marko Zagar
7a2ffda266 Mention ADT and zero-cost abstractions among modern features 2023-01-19 10:51:35 +00:00
Martin Geisler
48ec773052 Add support for translations
This implements a translation pipeline using the industry-standard
Gettext[1] system.

I picked Gettext for the reasons described in [2] and [3]:

* It’s widely used in open source software. This means that there are
  graphical editors which will help you in editing the `.po` files. An
  example is Poedit[4], which is available for all major platforms.

  There are also many online systems for doing translations. An
  example is Pontoon[5], which is used for the Rust website itself. We
  can consider setting up such an instance ourselves.

* It is a light-weight yet structured format. This means that nothing
  changes with regards to how you update the original English text. We
  can still accept fixes and PRs like normal.

  The structure means that translators can see exactly which part of
  the course they need to update after a change. This is completely
  lost if you simply copy over the original text and translate it
  in-place in the Markdown files.

The code here only adds support for translations. They are not yet
tested, published or used for anything. Next steps will be:

* Add support for switching languages via a bit of JavaScript on each
  page.

* Update the speaker notes feature to support translations (right now
  “Speaker Notes” is hard-coded into the generated HTML). I think we
  should turn it into a mdbook preprocessor instead.

* Add testing: We should test that the `.po` files are well-formed. We
  should also run `mdbook test` on each language since the
  translations can alter the embedded code.

Fixes #115.

[1]: https://www.gnu.org/software/gettext/manual/html_node/index.html
[2]: https://github.com/rust-lang/mdBook/pull/1864
[3]:
https://github.com/rust-lang/mdBook/issues/5#issuecomment-1144887806
[4]: https://poedit.net/
[5]: https://pontoon.rust-lang.org/
2023-01-18 16:12:53 +01:00
Martin Geisler
8e3941d2e6
Fix close tag on keyboard shortcut page (#179) 2023-01-18 10:57:31 +00:00
Martin Geisler
0324cd2b27
Merge pull request #176 from google/testing
Fix Rustdoc comment.
2023-01-17 17:32:39 +01:00
Andrew Walbran
8f6dcf35f5 Fix Rustdoc. 2023-01-17 16:07:10 +00:00
Zhizhen He
51ad97a8df
Fix typo (#173) 2023-01-17 11:42:31 +00:00
Brandon Pollack
13da3112e9
Ownership speaker notes (#172)
* ownership speaker notes

Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-01-17 08:09:14 +00:00
Andrew Walbran
1c7ce1cac6 Use a consistent order in memory layout of trait objects example. 2023-01-16 16:11:31 +00:00
Andrew Walbran
5cbb8d4c27 Add speaker notes about closures. 2023-01-16 16:11:31 +00:00
Andrew Walbran
a1861ef900 Add speaker notes for impl Trait. 2023-01-16 16:11:31 +00:00
Andrew Walbran
832c7e9963 Add speaker notes for Iterator, and an example using FromIterator. 2023-01-16 16:11:31 +00:00
sahennenkamp
93b20be600 Hint towards making library mut
Follow up to https://github.com/google/comprehensive-rust/pull/137
Gives the student a hint that it's okay to edit variables within main.
2023-01-16 11:06:40 +01:00
Yauheni Baltukha
4c8d85dc88 Fix typo in rust.md 2023-01-16 11:06:40 +01:00
Robin Stringer
71c68a6996 Adds speaker notes for 6.4.1. String vs str
Adds speaker notes including:
-Brief explanation of &str, String type
-String::from and String::new
-push_str method
2023-01-16 11:06:40 +01:00
Fabian Bornhofen
35893e2bc6
Update src/ownership/lifetimes-data-structures.md
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-13 12:47:15 +01:00
Fabian Bornhofen
53706056e3
Update src/ownership/lifetimes-data-structures.md
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-13 12:47:01 +01:00
Fabian Bornhofen
77f24ffab7 Add speaker notes for lifetimes-data-structures.md 2023-01-12 19:36:40 +01:00
Fabian Bornhofen
9c652d06aa Add speaker notes for moves-function-calls.md 2023-01-12 18:23:57 +01:00
Martin Geisler
67b65c5ee8
Simplify language in speaker notes 2023-01-12 17:13:46 +01:00
Robin Stringer
d85643d5ac
Update src/basic-syntax/slices.md
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-12 16:11:46 +00:00
Robin Stringer
f4b651456c
Speaker notes to 6.4 Slices
Brief digest of the slice type, including mentions of borrowing, range syntax and lifetimes.
2023-01-12 15:53:16 +00:00
Fabian Bornhofen
3dd03bbd65 Re-add link that is still in use 2023-01-12 12:33:03 +01:00
Fabian Bornhofen
92dafcb676
Merge pull request #158 from brandonpollack23/stackheap
Add speaker notes to stack and heap pages
2023-01-12 11:53:54 +01:00
Fabian Bornhofen
45e57e9359
Capitalization in stack.md 2023-01-12 11:51:37 +01:00
Fabian Bornhofen
7203bb8a65
Capitalization in src/memory-management/rust.md 2023-01-12 11:50:28 +01:00
Fabian Bornhofen
e8ed8cb5de Clean up playground link in borrowing.md 2023-01-12 11:32:11 +01:00
Fabian Bornhofen
83cd7ab67b Fix typo in borrowing.md 2023-01-12 11:27:57 +01:00
Fabian Bornhofen
a3ec024fba Fix formatting in compound-types.md 2023-01-12 11:26:48 +01:00
Ilya Grigoriev
acdf00ae6e Add speaker notes about error examples 2023-01-11 18:14:58 -08:00
Brandon Pollack
f750f75db6 stackheap notes 2023-01-12 11:12:53 +09:00
Fabian Bornhofen
a8fb8ad2b6
Merge pull request #120 from google/running-the-course
Add instructions about how to run the course
2023-01-11 18:28:22 +01:00
Fabian Bornhofen
0b7b69df10
Merge pull request #152 from google/solution-speaker-notes
Add speaker notes to exercise pages
2023-01-11 16:46:55 +01:00
Martin Geisler
d037d7b5c7
Merge pull request #133 from rastringer/patch-1
Adds speaker notes to Compound Types section
2023-01-11 15:51:53 +01:00
Martin Geisler
b6bec18875
Clarify that "fixed" means "compile-time constant" 2023-01-11 15:49:10 +01:00
Robin Stringer
41bb8acf3f
Removes out of bounds checks for simplicity
Removes the out of bounds checks to keep the notes simple.
2023-01-11 14:35:20 +00:00
Martin Geisler
6019a946d9
Merge pull request #154 from fbornhofen/speaker-notes
Speaker notes for box.md, rc.md, option-result.md
2023-01-11 14:49:03 +01:00
Martin Geisler
6b8ee3c979
Fix typo 2023-01-11 14:47:34 +01:00
Fabian Bornhofen
02e1f4b879 Add speaker notes for option-result.md 2023-01-11 14:19:21 +01:00
Fabian Bornhofen
dd194f07c9 Add speaker notes for rc.md 2023-01-11 14:04:30 +01:00
Fabian Bornhofen
5256d9c3fd Add speaker notes for box.md 2023-01-11 13:29:43 +01:00
Filipe Casal
de9d67205e
Fix typo on Luhn exercise 2023-01-11 12:11:06 +00:00
Martin Geisler
1085e9c20b Add speaker notes to exercise pages
The notes link to the corresponding solutions.
2023-01-11 12:49:59 +01:00
Martin Geisler
587645db6c
Clarify default vs debug output. 2023-01-11 10:49:21 +01:00
Martin Geisler
d1422e93c2
Merge pull request #149 from fbornhofen/speaker-notes-string
Add speaker notes for string.md
2023-01-10 19:55:59 +01:00
Martin Geisler
da81dfa07f
Simplify char count 2023-01-10 19:54:48 +01:00
Martin Geisler
08af7574bb Add instructions about how to run the course
I think we need a chapter “before the course” which gives people some
background information about how to run the course. This is the start
of this chapter, we might expand it in the future as we find more
things to communicate here.
2023-01-10 19:12:57 +01:00
Fabian Bornhofen
b2b11257f5 Add speaker notes for string.md 2023-01-10 19:06:06 +01:00
Martin Geisler
4e746482f2
Merge pull request #148 from fbornhofen/speaker-notes-if-let
Add speaker notes for if-let-expressions.md
2023-01-10 18:58:53 +01:00
Martin Geisler
1b3eaec5e7
Merge pull request #141 from brandonpollack23/static_const
Added notes, runtime constant eval, and footnoes to static-and-const.md
2023-01-10 18:53:46 +01:00
Martin Geisler
0d5232358b
Remove dangling footnote 2023-01-10 18:52:37 +01:00
Fabian Bornhofen
d42f0dcd46 Add speaker notes for if-let-expressions.md 2023-01-10 18:30:22 +01:00
Martin Geisler
20c0a37949
Merge pull request #139 from brandonpollack23/rust_ecosystem
Add more info and footnotes to rust-ecosystem.md
2023-01-10 17:51:44 +01:00
Martin Geisler
637b785714
Merge pull request #138 from brandonpollack23/cargo_page
Added some more detail on rustup.
2023-01-10 17:50:56 +01:00
Martin Geisler
3eee86f76d
Merge pull request #143 from fbornhofen/speaker-notes-copy-2
Rephrase copy/clone speaker notes
2023-01-10 17:47:27 +01:00
Martin Geisler
c994340a8f
Merge pull request #142 from fbornhofen/speaker-notes-fbornhofen
Add example for underscore syntax with generics (type-inference.md)
2023-01-10 17:46:20 +01:00
Martin Geisler
6b874844ca
Merge pull request #144 from fbornhofen/speaker-notes-rvo
Add speaker notes about RVO in borrowing.md
2023-01-10 17:45:39 +01:00
Martin Geisler
9448ae3e19
Merge pull request #146 from fbornhofen/speaker-notes-variant-payloads
Add speaker notes for variant-payloads.md
2023-01-10 17:44:49 +01:00
Fabian Bornhofen
8d2fb11adc Expand enum sizes example and add speaker notes 2023-01-10 17:36:16 +01:00
Fabian Bornhofen
c91cc629d5 Add speaker notes for variant-payloads.md 2023-01-10 16:46:57 +01:00
Fabian Bornhofen
91b8d33a99 Add speaker notes for shared and unique borrows 2023-01-10 15:51:56 +01:00
Fabian Bornhofen
d157b54fd4 Add speaker notes about RVO in borrowing.md 2023-01-10 15:04:17 +01:00
Brandon Pollack
0eec153927 move to reference links 2023-01-10 22:21:13 +09:00
Brandon Pollack
c2c3d48920 moved footnotes to speaker notes 2023-01-10 22:17:18 +09:00
Brandon Pollack
8dc2ea4503 Remove superfluous distracting info 2023-01-10 22:12:43 +09:00
Brandon Pollack
b5a7c9cdcc
clarify static details
Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-01-10 05:05:45 -08:00
Brandon Pollack
a532c23c60
Simplify wording of constexpr/const relation
Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-01-10 05:05:26 -08:00
Brandon Pollack
1196622b7a Removed magic incantation that should just be behind the link 2023-01-10 22:03:47 +09:00
Fabian Bornhofen
4fd8a2ca62 Rephrase bullet point in copy/clone slide 2023-01-10 14:01:08 +01:00
Brandon Pollack
3eecb4bef6
Add time of writing to reflect current status quo that might change
Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-01-10 05:00:59 -08:00
Fabian Bornhofen
87b26c78c0 Add not about C++ copy constructors 2023-01-10 13:57:15 +01:00
Fabian Bornhofen
65837087c9 Copy, clone speaker notes: phrase as sentences i/o questions 2023-01-10 13:55:43 +01:00
Fabian Bornhofen
d1a3290cd6 Add reference to collect, FromIterator 2023-01-10 11:40:02 +01:00
Fabian Bornhofen
b1069f863c Add example for underscore syntax with generics (type-inference.md) 2023-01-10 11:30:48 +01:00
Martin Geisler
e29c3bfb99
Merge pull request #123 from ilyagr/username_or_error
Error handling: clarify printing of Result
2023-01-10 10:21:43 +01:00
Martin Geisler
e43dec24fd
Tighten language 2023-01-10 09:29:57 +01:00
Brandon Pollack
89ddb2c197 Added notes, runtime constant eval, and footnoes to static-and-const.md 2023-01-10 13:41:31 +09:00
Brandon Pollack
d15a653ed8 Added some speaker notes to variables.md 2023-01-10 13:27:39 +09:00
Brandon Pollack
6a2889d8ce Add more info and footnotes to rust-ecosystem.md 2023-01-10 13:10:16 +09:00
Brandon Pollack
cec5e6d64e Added information on Jetbrains 2023-01-10 12:42:38 +09:00
Brandon Pollack
4172e7587c Added some more detail on rustup.
Rusutp is the reccomended way to install rust and maintained by the core
team.

I added some organization and suggested that that be the method of
installation.
2023-01-10 12:36:51 +09:00
Martin Geisler
bee9cdab92
Merge pull request #136 from fbornhofen/speaker-notes-variables
Add speaker notes for scopes-shadowing.md
2023-01-09 18:44:29 +01:00
Martin Geisler
c5824aece0
Merge pull request #134 from fbornhofen/speaker-notes-fbornhofen
Speaker notes for lifetimes-function-calls.md
2023-01-09 18:43:56 +01:00
Fabian Bornhofen
2ec7bdf15d Ignore code block that deliberately contains an error 2023-01-09 17:36:58 +01:00
Fabian Bornhofen
3a4d5d4c26 Add complete code block for lifetimes example 2023-01-09 17:32:37 +01:00
Fabian Bornhofen
77d3ac01e7 Add speaker notes for scopes-shadowing.md 2023-01-09 17:21:54 +01:00
Fabian Bornhofen
ba09385c4a Add bullet point about mutable references 2023-01-09 16:54:14 +01:00
Fabian Bornhofen
512dedf729 Make instructions in lifetimes-function-calls.md more precise 2023-01-09 16:31:09 +01:00
Fabian Bornhofen
597c875442 Add speaker notes to lifetimes-function-calls.md 2023-01-09 16:27:10 +01:00
Robin Stringer
6fac027dd6
Updates PR with code formatting
Backticks for inline and single line code blocks / examples.
2023-01-09 14:42:27 +00:00
Robin Stringer
9cd5d25821
Adds speaker notes to Compound Types section
Speaker notes for 6. Basic Syntax, 6.2 Compound Types section.
Briefly explains arrays and tuples properties.
Adds option for instructor to check for out of bounds errors using assert!().
2023-01-09 14:18:37 +00:00
Martin Geisler
3ff2d5f43a
Merge pull request #118 from google/exercise-code-snippets
Explain why exercises are not editable
2023-01-09 14:42:54 +01:00
Martin Geisler
affb2526fe Explain why exercises are not editable
From a discussion in #23.
2023-01-09 14:41:48 +01:00
Martin Geisler
e835ee6cdf Add notes to threads.md
From the discussion in #63.
2023-01-09 14:32:04 +01:00
Martin Geisler
f4b753b7c5 Speaker notes for “Rust Ecosystem” 2023-01-09 14:27:13 +01:00
Martin Geisler
62d206506f Speaker notes for “Running Cargo Locally” 2023-01-09 14:27:13 +01:00
Martin Geisler
3db19fd2e5 Speaker notes for “Using Cargo” 2023-01-09 14:27:13 +01:00
Martin Geisler
b1e11304a7 Speaker notes for “Runtime Guarantees” 2023-01-09 14:27:13 +01:00
Martin Geisler
ba3c6b0de9 Speaker notes for “Modern Features” 2023-01-09 14:27:13 +01:00
Martin Geisler
cf505e99cd Rephrase “No memory leaks”
The footnote was added before we had support for speaker notes. It’s
too large to show on the screen during a classroom presentation, so it
has now been moved to the speaker notes.

I tried to keep the information intact, including keeping the word
“mostly” on the slide.
2023-01-09 14:26:47 +01:00
Martin Geisler
a7adf49002 Speaker notes for “Why Rust?” 2023-01-09 14:26:47 +01:00
Martin Geisler
50b0ad76eb Introduce speaker notes on welcome page 2023-01-09 14:24:02 +01:00
Fabian Bornhofen
0723135dc6 Remove bullet point about printing p1 2023-01-09 13:39:39 +01:00
Fabian Bornhofen
45bc1233d2 s/twice/again/ 2023-01-09 13:37:06 +01:00
Fabian Bornhofen
e213f9dbd3 Add speaker notes to copy-clone.md 2023-01-09 13:20:00 +01:00
Zhizhen He
b287aeada1
Fix typo in structure.md 2023-01-09 02:01:28 +08:00
Martin Geisler
7e0670e6b7
Merge pull request #126 from marshallpierce/patch-2
Use rustls instead of openssl
2023-01-07 14:50:18 +01:00
Michael Lee
3f4ae0606d Update broken links 2023-01-07 15:38:40 +08:00
Marshall Pierce
b67908698f Use rustls instead of openssl
Using the `rustls-tls` feature on reqwest will use rustls and ring, which should compile on any system.
2023-01-06 15:22:40 -07:00
Ilya Grigoriev
68eed5b4f2
Error handling: clarify printing of Result
Two examples may print either `Ok(username)` or `Err(error)`.
This commit clarifies this fact.
2023-01-06 12:35:05 -08:00
Marshall Pierce
0a9dd33e58
Create an empty rather than pre-allocating
It might give the impression that you can only write to a Vec that has capacity, when in fact Vec's Write impl will grow the storage as needed. While pre-allocating is probably a good efficiency win in many circumstances, I think it's probably worth minimizing the number of concepts in play in this example.
2023-01-06 09:47:42 -07:00
鐘天楽
c8f626e573
for-loop bonus explanation (#108)
* for-loop bonus explanation
2023-01-06 10:15:16 +01:00
Martin Geisler
9a68434cac
Merge pull request #49 from ilyagr/patch-1
`anyhow`: Remove `ReadUsernameError::IoError`
2023-01-05 15:57:17 +01:00
Arman Yessenamanov
e1c670c4a8
Fix a typo in result.md
"have already see" -> "have already seen"
2023-01-05 14:41:40 +06:00
Martin Geisler
8feb6b4ad4
Merge pull request #109 from rhapsodyai/fixes-99
Fixes: #99
2023-01-05 09:08:03 +01:00
Martin Geisler
d5359fa92a Add support for speaker notes
This implements a system for speaker notes via `details` elements and
some JavaScript. The general idea is

1. You add speaker notes to each page by wrapping some Markdown code
   in `<details> … </details>`. This is a standard HTML element for,
   well extra details. Browsers will render the element with a toggle
   control for showing/hiding the content.

2. We inject JavaScript on every page which finds these speaker note
   elements. They’re styled slightly and we keep their open/closed
   state in a browser local storage. This ensures that you can keep
   them open/closed across page loads.

3. We add a link to the speaker notes which will open in a new tab.
   The URL is amended with `#speaker-notes-open`, which we detect in
   the new tab: we hide the other content in this case.
   Simultaneously, we hide the speaker notes in the original window.

4. When navigating to a new page, we signal this to the other window.
   We then navigate to the same page. The logic above kicks in and
   hides the right part of the content. This lets the users page
   through the course using either the regular window or the speaker
   notes — the result is the same and both windows stay in sync.

Tested in both Chrome and Firefox. When using a popup speaker note
window, the content loads more smoothly in Chrome, but it still works
fine in Firefox.

Fixes #53.
2023-01-05 07:46:18 +01:00
Melissa Auclaire
115c87d8fd Fixes: #99 2023-01-04 17:55:28 -08:00
Andrew Walbran
28942d7b9f
Merge pull request #36 from daym/patch-1
Tuples with "..." make no sense, so don't use them
2023-01-04 15:42:35 +00:00
Andrew Walbran
9f46beafdb
Merge pull request #105 from Adrian-Samoticha/patch-1
Fix typo in `modules.md`
2023-01-04 15:42:07 +00:00
Adrian Samoticha
a0ad1eafa8
Fix typo in visibility.md 2023-01-04 15:58:34 +01:00
Adrian Samoticha
89ad1f6a65
Fix typo in modules.md 2023-01-04 15:44:37 +01:00
Martin Geisler
c2c11531a5
Merge pull request #96 from zhouwfang/simplify-solution-to-prefix-matching
Simplify the solution to prefix matching
2023-01-04 09:11:58 +01:00
liao02x
8d36a3bdd3
fix typo in deriving-error-enums.md 2023-01-03 21:18:30 -08:00
Zhou Fang
1fb0b0a46d Simplify solution to prefix matching. 2023-01-03 20:11:20 -08:00
Martin Geisler
b027db0241
Add back links to the Rust Book
I think it's important that we link the students to the full information about Unsafe Rust.
2023-01-02 10:30:40 +01:00
MaschitaG
b2ae19b5fd
Update static-and-const.md 2023-01-02 10:25:39 +01:00
MaschitaG
1c1c3d38d8
Unsafe Rust
Unsafe Rust is mentioned in the course
2023-01-02 10:12:56 +01:00
Martin Geisler
12c110d172
Merge pull request #93 from Fosco1/patch-1
Corrected typo on receiver.md
2023-01-02 10:08:42 +01:00
Fosco1
a4bd084e50
Corrected typo on receiver.md
https://dictionary.cambridge.org/it/grammatica/grammatica-britannico/it-s-or-its
2023-01-02 10:04:04 +01:00
MaschitaG
a7461f805a
Update welcome.md
Make the language more precise
2023-01-02 10:01:10 +01:00
Seamus Connor
6cb3254cf1
Correct compilation error in unit-tests.md 2023-01-01 13:57:19 -08:00
Martin Geisler
51cbf29d92
Merge pull request #79 from riking/patch-1
comparison: copyedit 'delays' to 'delayed'
2022-12-31 12:35:24 +01:00
Martin Geisler
150e78a3f9
Rephrase destructor delays
After a discussion, it seems singular works well.
2022-12-31 12:33:57 +01:00
Martin Geisler
8a8f44b568
Merge pull request #89 from jswalden/patch-3
Typo in "Fearless Concurrency" intro
2022-12-31 12:27:00 +01:00
Jeff Walden
1ae03443d5
"a classic problem", not "...problems" 2022-12-30 21:54:35 -08:00
Jeff Walden
9def3e371d
Typo in "Fearless Concurrency" intro
"referred to a _fearless concurrency_" -> "referred to a*s* _fearless concurrency_"
2022-12-30 20:53:38 -08:00
Martin Geisler
d8fd38b88a
Merge pull request #81 from google/utf-8-encoding
Mention that strings are UTF-8 encoded
2022-12-28 20:38:46 +01:00
Martin Geisler
d7a33f24a6
Merge pull request #83 from google/mention-arc
Mention `Arc` on `Rc` slide
2022-12-28 20:38:22 +01:00
Martin Geisler
4a0455f5bd
Merge pull request #85 from der3318/update-test-cases-for-polygons
Better Test Case for Day 2 Polygon Exercise
2022-12-28 15:46:15 +01:00
Martin Geisler
6851a6b533
Show different tuple sizes 2022-12-28 15:41:08 +01:00
Der Chien
0b77fc6bf3
20221228 revert the points length check 2022-12-28 22:39:52 +08:00
Der Chien
42494f95ab
20221228 add one more point to the polygon 2022-12-28 21:49:01 +08:00
Arman Yessenamanov
8470be86d0
Fix a typo 2022-12-28 18:58:23 +06:00
Martin Geisler
7ee63aced6
Mention Arc on Rc slide
Fixes #67.
2022-12-28 10:15:17 +01:00
Martin Geisler
cac0641a54
Mention that strings are UTF-8 encoded
Technically, it's the Rust source file that is UTF-8 encoded, but in practical terms, this means that the string literals are UTF-8 encoded. It's only if you start using non-ASCII identifiers that you end up with UTF-8 encoded text outside of a string literal.

Fixes #35.
2022-12-28 09:32:28 +01:00
Martin Geisler
dcf29d4653
Merge pull request #74 from google/try-operator
More precise phrasing of what ? expands to
2022-12-28 09:26:18 +01:00
Martin Geisler
94cd8bb592
Link to reference on method receiver types 2022-12-28 09:19:19 +01:00
Kane York
de7d91752f
comparison: copyedit 'delays' to 'delayed'
This is the correct grammatical form for the bullet point, it expands into "Destructors [of objects are] delayed."
2022-12-27 14:13:10 -08:00
Martin Geisler
82a2f4c423
Mention that there are other receiver types 2022-12-27 18:16:21 +01:00
Martin Geisler
c15e84f63e
More precise phrasing of what ? expands to
As per the suggestion from @QuineDot in #65.
2022-12-27 18:09:54 +01:00
Martin Geisler
c7eff6b85e
Merge pull request #55 from Arthur-Milchior/patch-5
Fix typo on Send+Sync page
2022-12-27 17:19:07 +01:00
Martin Geisler
4295b8da5c
Further refine language as per @QuineDot's idea 2022-12-27 17:17:38 +01:00
Martin Geisler
f217cd12a2
Merge pull request #54 from Arthur-Milchior/patch-4
Typos
2022-12-27 17:16:13 +01:00
Martin Geisler
cc0c02aa14
Copy-editing on the shared state page
The access is to the specific `T` value found in the `Mutex<T>`.
2022-12-27 17:14:45 +01:00
Martin Geisler
d052db8874
Merge pull request #73 from janosh/fix-casing-types-bit-width
Fix casing in type bit widths
2022-12-27 16:46:57 +01:00
Martin Geisler
bc37d48cb0
Merge pull request #61 from pdecat/patch-1
Remove misplaced "calls"
2022-12-27 16:40:08 +01:00
Janosh Riebesell
cf695a99e3
fix casing in type bit widths 2022-12-26 19:35:09 -08:00
Patrick Decat
b5cbe4896b
Remove misplaced "calls" 2022-12-26 11:22:00 +01:00
Mathias M
fe3651df02
Fixes typo 2022-12-26 09:12:00 +01:00
Tom Niget
f82867b2bb
Precise what the Android parts are about (fixes #56) 2022-12-25 17:12:42 +01:00
Arthur Milchior
2b2e006417 Typo
Not sure of the intended meaning. At least the sentence is true and gramattically correct here
2022-12-24 20:39:48 -08:00
Arthur Milchior
94933b43f1
Typos 2022-12-24 20:23:43 -08:00
Jeff Walden
75f6d0b5bd
Insert "a" in a sentence that's missing it 2022-12-23 23:05:21 -08:00
Ilya Grigoriev
5ce7a08f0e
anyhow: say this example has fewer custom types 2022-12-23 13:35:40 -08:00
Ilya Grigoriev
894e694cdb
anyhow: Remove ReadUsernameError::IoError
As far as I understand, the example with the `anyhow` example
does not use its special `IoError` anymore, unlike the previous
example with just `thiserror`.

I think this should be made clear. I considered just adding a
`// Now unused` comment, but I think ti's clearer to just remove
the unused code.
2022-12-23 13:32:03 -08:00
Martin Geisler
0218fdb1f0
Merge pull request #46 from matm/patch-1
Fixes typo in comment
2022-12-23 14:26:30 +01:00
Martin Geisler
80edc895db
Merge pull request #42 from reillyeon/patch-2
Change "semantics is" to "semantics are"
2022-12-23 12:57:32 +01:00
Martin Geisler
2b91c8c818
Merge pull request #44 from drgnchan/patch-1
Fix grammer in references-dangling.md
2022-12-23 12:41:59 +01:00
Mathias M
69cd18f12a
Fixes typo in comment 2022-12-23 12:03:03 +01:00
Martin Geisler
61aa12e3f3
Merge pull request #27 from taufik-rama/docs/rustup-installation
Mention rustup.rs on the installation page

Fixes #19.
2022-12-23 11:41:30 +01:00
Martin Geisler
1b59aa5d71
Merge pull request #45 from Arthur-Milchior/patch-3
Makes ownership of `self` more accurate
2022-12-23 11:39:08 +01:00
Martin Geisler
952e778527
Merge pull request #43 from reillyeon/patch-3
Grammar fix in ownership/lifetimes-function-calls.md
2022-12-23 11:34:51 +01:00
Martin Geisler
21a2bb235f
Merge pull request #41 from reillyeon/patch-1
Fix C array syntax in memory-management/manual.md
2022-12-23 11:27:15 +01:00
Taufik Rama
b9085905f1 Simplifies rustup 2022-12-23 17:11:24 +07:00
Arthur Milchior
3631117446
Makes ownership of self more accurate
It’s entirely possible that a method gives ownership of self to another object, or return `self`. 
For example
```
    fn id(self) -> Self {
        return self;
    }
```
or more realistically 
```
    fn or(self, other) -> Self {
      if (self.isValid()) { return self;}
      return other;
    }
```
2022-12-23 00:16:42 -08:00
drgnchan
73e9a0b854
Update references-dangling.md 2022-12-23 15:41:41 +08:00
Reilly Grant
9464def62e
Grammar fix in ownership/lifetimes-function-calls.md 2022-12-22 22:09:17 -08:00
Reilly Grant
5223ef8f25
Change "semantics is" to "semantics are"
Subject-verb agreement.
2022-12-22 22:05:38 -08:00
Reilly Grant
16d4d2c92f
Fix C array syntax in memory-management/manual.md
Heap-allocated arrays in C use `int*` instead of `int[]`.
2022-12-22 21:58:08 -08:00
Kian-Meng Ang
54adbe7f55 Misc doc fixes
List of changes:
- fix typos found via `codespell -S target -L crate`
- ignore Cargo.lock
2022-12-23 11:24:51 +08:00
Martin Geisler
264047445f
Merge pull request #28 from zdimension/patch-2
Add footnote about memory leaks
2022-12-22 20:29:10 +01:00
Danny Milosavljevic
4126cbd519
Tuples with "..." make no sense, so don't use them 2022-12-22 20:25:15 +01:00
Martin Geisler
06b594b47a
Merge pull request #26 from mxschumacher/patch-1
Fix typo
2022-12-22 20:18:54 +01:00
Tom Niget
3bed28a9d9
Add "mostly" 2022-12-22 20:18:36 +01:00
Laurent Lyaudet
1315481e69
Corrected 1 or 2 typos
missing verb :
"The goal of the course to teach you Rust." -> "The goal of the course is to teach you Rust."

missing of ? :
"to cover all it" -> "to cover all of it"
for this one, I'm not a native english speaker but it seems more correct to me. I'll let you check :)
2022-12-22 18:33:02 +01:00
Tom Niget
5dd366d7db
Remove part about Rc 2022-12-22 14:24:47 +01:00
Tom Niget
7b7b56398e
Add footnote about memory leaks 2022-12-22 14:03:18 +01:00
Taufik Rama
b9eed2a072 Minor sidenote for rustup installation as an alternative to distro package manager 2022-12-22 19:49:58 +07:00
Martin Geisler
15b8ca8a05
Merge pull request #22 from Arthur-Milchior/patch-1
Clarify from/into
2022-12-22 13:23:55 +01:00
Max Schumacher
adc64c020b
fix typo 2022-12-22 11:52:44 +01:00
Martin Geisler
121a7d33f3
Merge pull request #7 from andrewpollack/patch-5
Minor punctuation update
2022-12-22 10:08:16 +01:00
Martin Geisler
0e74800885
Merge pull request #9 from andrewpollack/patch-7
Minor punctuation addition
2022-12-22 10:07:58 +01:00
Andrew Pollack
7a215992b4
Minor typo, punctuation update (#5)
* Minor typo
2022-12-22 10:07:26 +01:00
Martin Geisler
d66506fe35
Merge pull request #3 from andrewpollack/patch-1
Adding colon punctuation to lists
2022-12-22 10:06:15 +01:00
Martin Geisler
1a7df6cfb1
Merge pull request #6 from andrewpollack/patch-4
Minor punctuation update
2022-12-22 10:05:53 +01:00
Martin Geisler
ed0a11a86b
Merge pull request #10 from andrewpollack/patch-8
Minor punctuation update
2022-12-22 10:05:08 +01:00
Arthur Milchior
638dde7704
Clarify from/into
I found the phrasing confusing. Mentionning that a class implements From and then using `into()` seems confusing. It looks like that you meant that it implements `Into`.
So I believe that a little more details may help show why this exercise is valid.

I would have considered clarifying that `into` does not need to specify that we use the implementation for `i16` thanks to type analysis, but I assume this would add too much text, and this can either be ignored by the reader for the time being, or guessed
2022-12-21 16:46:23 -08:00
Kentaro Okuda
62f530d5ac typo: assigment -> assignment 2022-12-21 19:45:02 -05:00
Tom Niget
b411aa688a typo: hygenic -> hygienic 2022-12-21 21:43:53 +00:00
sharnoff
a6b5c7171d grammar/typo: it's -> its 2022-12-21 21:42:58 +00:00
Martin Geisler
a96f48456d
Merge pull request #15 from jrvanwhy/unsafe-skip-details
`welcome.md`: indicate we skip the subtle details of unsafe Rust
2022-12-21 19:19:20 +01:00
Martin Geisler
24283c9806
Merge pull request #4 from andrewpollack/patch-2
Suggestion: link to Cargo book on introduction
2022-12-21 19:03:43 +01:00
Martin Geisler
d4655aae9d
Merge pull request #13 from andrewpollack/patch-10
Minor punctuation update
2022-12-21 19:03:19 +01:00
Johnathan Van Why
8f60685165 welcome.md: indicate we skip the subtle details of unsafe Rust
This sentence was missing a negation: it was supposed to say this course does not cover unsafe Rust in depth, but actually said "we go into the subtle details". This PR adds the missing negation.
2022-12-21 10:01:11 -08:00
Andrew Pollack
d752b11694
Minor punctuation update (#11)
* Minor punctuation update

* Update sync.md
2022-12-21 17:41:58 +00:00
Andrew Pollack
e203586182
Minor punctuation update 2022-12-21 09:38:05 -08:00
Andrew Pollack
6809d4ef78
Minor punctuation update 2022-12-21 09:33:44 -08:00
Andrew Pollack
6d622a8d58
Minor punctuation addition 2022-12-21 09:31:53 -08:00
Andrew Pollack
9c1a1a6d90
Add link to FizzBuzz definition
For those who are lucky enough to not know what FizzBuzz intends to accomplish 😹
2022-12-21 09:30:55 -08:00
Andrew Pollack
62c856f1d7
Minor punctuation update 2022-12-21 09:29:04 -08:00
Andrew Pollack
4648bd1f8e
Minor punctuation update
Bringing list punctuation in line with rest of course
2022-12-21 09:27:46 -08:00
Andrew Pollack
f155d68a8d
Suggestion: link to Cargo book on introduction 2022-12-21 09:22:30 -08:00
Andrew Pollack
90e23ab4c6
Adding colon punctuation to lists
Minor addition to make punctuation consistent on Welcome page
2022-12-21 09:20:30 -08:00
Andrew Walbran
f3ff5b994b
Fix typo 2022-12-21 16:02:37 +00:00
Martin Geisler
c212a473ba Publish Comprehensive Rust 🦀 2022-12-21 16:38:28 +01:00