1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-14 21:35:00 +02:00
Commit Graph

59 Commits

Author SHA1 Message Date
8df1d74e73 Fix some minor typos (#910)
* aspect-ratio-helper.py: fix typo

* basic syntax: make 'bits' plural in all occurrences
2023-07-06 08:39:47 +00:00
305bdbb29a Fix slices immutable example (#686) 2023-06-06 09:17:55 +00:00
032c7e3b6b Fix typo in basic/syntax-static-and-const.md (#650)
Fix typo in basic/syntax-static-and-const.md.
2023-05-22 09:36:52 +01:00
f02facd56d Add missing newlines around <details> (#647)
The newlines makes the text more uniform when extracted into the POT
file (spotted while doing #646).
2023-05-19 09:43:44 -04:00
a788680d5e Fixing a typo in a "details" close tag (#638) 2023-05-15 22:20:54 +00:00
841359f5df Simplify methods slide (#594)
This tightens the language slightly. I also added a speaker note with
suggestions for more methods to add (if there is time).
2023-05-03 12:01:21 +02:00
4a09d053ac Simplify fizz buzz slide (#595)
There is no need to introduce `match` here where we don’t have time to
talk about it in detail.
2023-05-03 09:56:58 +02:00
f895ffc5a8 Remove exotic string types from scalar type slide (#593)
When teaching the class, I’ve noticed that raw strings and byte
strings tend to cause confusion. The slide is meant to be a friendly
introduction and show how Rust is similar to other languages like C
and C++. Instead, the string types cause a ton of questions which are
unnecessary at this early point.

The information is still there, but now in the form of a speaker note.
2023-04-27 19:57:07 +02:00
3b538b582d Add a brief mention of doc comments (#509) 2023-03-21 12:15:07 -04:00
9bb586689a Minor grammar fixes to type-inference.md (#437) 2023-02-19 09:27:56 +01:00
ace97aaeb2 Fix typo in basic-syntax/variables.md. (#339) 2023-02-03 15:30:44 +00:00
10ca7b1b2d More fixes and additions to Day1 Morning (#269)
* Corrections around slices and string slices, also slight improvements to the language.

* Explained some of the confusing details in the functions example.

* Added a speaker note (hinting at `Into`  as a complement to generics).

* Exclude the clarification code snippet from build testing.

* Update functions-interlude.md

Do not mention explicit section numbers as they may change.
2023-01-24 15:20:18 +01:00
6702accbbb Update string-slices.md (#209)
* Update string-slices.md

* Adding an extra example of converting `String` back to `&str`.
* C++ who would often read this guide could get immediate intuitive understanding of Rust strings if you compare them to C++ equivalents.

* Expand on `String` vs `std::string`

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-24 08:52:55 +00:00
fe8fa8d232 Update Speaker Notes for slices.md (#208)
It makes sense to add a speaker note about the question asked.
2023-01-23 21:23:41 +01:00
49c9ba692e Update static-and-const.md (#215)
Let's not use the word "lifetime" just yet. It is arguably the heaviest topic in Rust and it was not yet introduced.
2023-01-23 17:15:54 +01:00
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
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
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
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
6bda89f34e Clarification on references 2023-01-19 10:51:35 +00:00
529d4bf20c Speaker note tweaks for compound types 2023-01-19 10:51:35 +00:00
47435cbf41 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-13 13:14:19 +00:00
67b65c5ee8 Simplify language in speaker notes 2023-01-12 17:13:46 +01:00
d85643d5ac Update src/basic-syntax/slices.md
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-12 16:11:46 +00:00
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
3dd03bbd65 Re-add link that is still in use 2023-01-12 12:33:03 +01:00
a3ec024fba Fix formatting in compound-types.md 2023-01-12 11:26:48 +01:00
d037d7b5c7 Merge pull request #133 from rastringer/patch-1
Adds speaker notes to Compound Types section
2023-01-11 15:51:53 +01:00
b6bec18875 Clarify that "fixed" means "compile-time constant" 2023-01-11 15:49:10 +01:00
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
587645db6c Clarify default vs debug output. 2023-01-11 10:49:21 +01:00
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
0d5232358b Remove dangling footnote 2023-01-10 18:52:37 +01:00
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
8dc2ea4503 Remove superfluous distracting info 2023-01-10 22:12:43 +09:00
b5a7c9cdcc clarify static details
Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-01-10 05:05:45 -08:00
a532c23c60 Simplify wording of constexpr/const relation
Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-01-10 05:05:26 -08:00
d1a3290cd6 Add reference to collect, FromIterator 2023-01-10 11:40:02 +01:00
b1069f863c Add example for underscore syntax with generics (type-inference.md) 2023-01-10 11:30:48 +01:00
e43dec24fd Tighten language 2023-01-10 09:29:57 +01:00
89ddb2c197 Added notes, runtime constant eval, and footnoes to static-and-const.md 2023-01-10 13:41:31 +09:00
d15a653ed8 Added some speaker notes to variables.md 2023-01-10 13:27:39 +09:00
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
77d3ac01e7 Add speaker notes for scopes-shadowing.md 2023-01-09 17:21:54 +01:00
ba09385c4a Add bullet point about mutable references 2023-01-09 16:54:14 +01:00
6fac027dd6 Updates PR with code formatting
Backticks for inline and single line code blocks / examples.
2023-01-09 14:42:27 +00:00
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
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
b2ae19b5fd Update static-and-const.md 2023-01-02 10:25:39 +01:00
6851a6b533 Show different tuple sizes 2022-12-28 15:41:08 +01:00