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

68 Commits

Author SHA1 Message Date
Dominik Maier
2685d8ec0d
New is implied in square (#1010) 2023-07-24 08:10:47 -04:00
Martin Geisler
94e5db7ddb
Fix capitalization of Rust (#1007) 2023-07-18 12:41:27 +02:00
Dominik Maier
cb689be312
Static variables don't need unsafe (#995) 2023-07-17 22:23:03 -07:00
Dominik Maier
21ea796e3b
Move to more legible types (#989)
* Move to more legible types

* Add information about underscores
2023-07-17 22:12:51 -07:00
Dominik Maier
e59a87f0c0
Clarify constructors in the speaker notes for methods (#992) 2023-07-17 17:17:26 -04:00
Dominik Maier
ba403016b9
Add note about doc tests (#991) 2023-07-17 17:16:23 -04:00
Dominik Maier
4fe28011a0
Fix links to FromIterator, HashSet (#993) 2023-07-17 15:10:02 -04:00
Dominik Maier
9e825fbd59
Clarify the "Slices" question and fix the answer (#990)
Clarify the question and fix the answer
2023-07-17 16:32:49 +00:00
Frances Wingerter
abb05164da
Clarify a couple minor points (#912)
* compound types: disambiguate that length is not 'same'

* basic syntax: clarify preference for consts and quickly justify unsafety of static mut

* basic-syntax: take review feedback into account on consts/statics

* basic-syntax: be careful not to call `const` defns variables

variables in rust are `place`s in a formal sense and name objects in an informal one; `const` merely abbreviates an expression
2023-07-12 18:37:49 +01:00
Frances Wingerter
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
Gershon Papi
305bdbb29a
Fix slices immutable example (#686) 2023-06-06 09:17:55 +00:00
Victor Costan
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
Martin Geisler
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
Diogo Anderson
a788680d5e
Fixing a typo in a "details" close tag (#638) 2023-05-15 22:20:54 +00:00
Martin Geisler
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
Martin Geisler
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
Martin Geisler
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
Dustin J. Mitchell
3b538b582d
Add a brief mention of doc comments (#509) 2023-03-21 12:15:07 -04:00
Adam MacBeth
9bb586689a
Minor grammar fixes to type-inference.md (#437) 2023-02-19 09:27:56 +01:00
gendx
ace97aaeb2
Fix typo in basic-syntax/variables.md. (#339) 2023-02-03 15:30:44 +00:00
Marko Zagar
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
Igor Petruk
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
Igor Petruk
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
Igor Petruk
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
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
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
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
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
Robin Stringer
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
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
a3ec024fba Fix formatting in compound-types.md 2023-01-12 11:26:48 +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
587645db6c
Clarify default vs debug output. 2023-01-11 10:49:21 +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
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
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
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
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