1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-02 11:03:18 +02:00
Commit Graph

397 Commits

Author SHA1 Message Date
Martin Geisler
690039fd53
Filter out “fuzzy” translations (#212)
When the source text is updated, existing translations become
outdated. The `msgmerge` program will attempt to find a similar source
text among the existing translations and will reuse the translation.
The translation is marked “fuzzy” to signal to the translator that it
needs to be proofread.
2023-01-28 14:36:57 +01:00
Andrew Walbran
27b6165202 Implement Error. 2023-01-27 17:54:37 +00:00
Andrew Walbran
caaca140ca Another note for anyhow. 2023-01-27 17:54:37 +00:00
Andrew Walbran
79f5f0dade Add slide about Box<dyn Error> before introducing anyhow. 2023-01-27 17:54:37 +00:00
Andrew Walbran
e5c97e12cb No need for thiserror as well as anyhow. 2023-01-27 17:54:37 +00:00
Andrew Walbran
9fa0e89e90 It makes no sense to use both return and ?. 2023-01-27 17:54:37 +00:00
Andrew Walbran
52d28b155b Mention std::error::Error in speaker notes, and other useful traits. 2023-01-27 17:54:37 +00:00
Andrew Walbran
5dd87192e8 Mention that Send and Sync are unsafe traits. 2023-01-27 17:34:31 +00:00
Andrew Walbran
81cf02ffbe Fix typos and details. 2023-01-27 17:34:31 +00:00
Andrew Walbran
cc402a7788 Add some speaker notes to concurrency chapter. 2023-01-27 17:34:31 +00:00
Martin Geisler
ee36ae318f
Add an aspect-ratio-helper mdbook preprocessor (#187)
The idea is that this will help us make better slides: we can see at a
glance when the slide becomes too full.
2023-01-27 18:30:37 +01:00
Andrew Walbran
c066ab5664 Mention other ABI options. 2023-01-27 17:17:37 +00:00
Andrew Walbran
95c0447e4b Remove comment inside unsafe block.
Martin thinks the safety comment at the top is enough.
2023-01-27 17:17:37 +00:00
Andrew Walbran
facbac4601 Fix typo, and this is not specific to glibc. 2023-01-27 17:17:37 +00:00
Andrew Walbran
6e7916c29b Add a slide about writing unsafe functions. 2023-01-27 17:17:37 +00:00
Andrew Walbran
3cadad4e0a Add slide for unsafe traits. 2023-01-27 17:17:37 +00:00
Andrew Walbran
8c2b3781bb Move extern functions slide under unsafe functions. 2023-01-27 17:17:37 +00:00
Andrew Walbran
7deb5532ea Add speaker notes for extern functions. 2023-01-27 17:17:37 +00:00
Andrew Walbran
d07171e76d Add safety comment. 2023-01-27 17:17:37 +00:00
Andrew Walbran
47e28e87c0 Add speaker notes for unions. 2023-01-27 17:17:37 +00:00
Andrew Walbran
d7fcf8216a Mutable statics are generally a bad idea. 2023-01-27 17:17:37 +00:00
Andrew Walbran
9bed4fce3c Add speaker notes and safety comment for raw pointers. 2023-01-27 17:17:37 +00:00
Andrew Walbran
062905e7d7 There's no name involved here. 2023-01-27 17:17:37 +00:00
Andrew Walbran
e0cb292624 Put unsafe slides in same order as they are introduced in unsafe.md. 2023-01-27 17:17:37 +00:00
Martin Geisler
4409f330c5
Move GA code directly into main page (#289)
This replaces a bit of code with the equivalent HTML code.

We also load the script async, which means that the browser won’t
block rendering while waiting for the scripts.
2023-01-27 14:37:17 +01:00
Charisee Chiw
1453e1d5bb Update blocks.md 2023-01-27 12:03:49 +00:00
Igor Petruk
585509bb0a
Update points-polygons.md (#234)
Adding speaker notes with key things that might be present in the solution.
2023-01-26 19:04:03 +01:00
Charisee Chiw
4588d95427 Update match-guards.md 2023-01-26 12:08:21 +00:00
Davide Guerri
a0a1059c0d Verbose description of Sync-Send relationship
Add a verbose rationale of the statement:
  `T` is `Sync` if and only if `&T` is `Send`
2023-01-26 12:06:54 +00:00
Alexei Ermakov
f0310f4f61 Fixed link to IntoIterator for Vec doc 2023-01-26 12:04:58 +00:00
rbehjati
f15fc1a0b8
Add discussion points for traits (#180)
* Some discussion points for traits
* Add answers
2023-01-26 09:14:05 +00:00
upsidedwn
ec01563bd6
Propose to use the generic term perimeter instead of circumference for shapes (#281)
* Update unit tests to use generic perimeter

* Update solution to use perimeter

Update solution to use the generic term perimeter instead of circumference
2023-01-26 08:59:13 +00:00
Martin Geisler
438c16607d
Add theme generated with mdbook init --theme (#189)
This will allow us to customize the appearance more easily: we can
move the GA logic into the theme (to reduce load times and to simplify
the JS injection logic). We can also add new elements, which is what I
will do next.

The mdbook theme can be added incrementally: if we don’t add a file to
our theme folder, we will get the corresponding file from mdbook.
2023-01-25 21:31:22 +01:00
Kostis Andrikopoulos
4fed580efa
Add trailing backslash for multiline command (#277)
There were some backslashed missing in the command to serve the
translated book. Thus the shell would execute the lines one after the
other, instead of as one command.

This lead to the environment variables not actually being set, and thus
the non-translated version was served anyway.
2023-01-25 18:26:58 +01:00
Charisee Chiw
f3446a9176
Speaker notes for methods.md (#202)
* Update methods.md

* Update methods.md

* Update methods.md

* Reword explanation of methods

Co-authored-by: Andrew Walbran <qwandor@google.com>
2023-01-24 10:46:13 -08:00
Igor Petruk
da666548a7
Update example.md (#230)
Adding the line that you can no longer call `add_lap` after the race is finished.
2023-01-24 15:27:29 +01:00
Igor Petruk
b12a1cb320
Update example.md (#257)
Adding a possible solution to the example that
does not compile. The solution includes notes
with important parts.
2023-01-24 15:25:18 +01: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
Andrew Walbran
b064642b02 Make program consistent with output given. 2023-01-24 11:45:04 +00:00
Andrew Walbran
536c1dc90b Speaker notes for Android chapter. 2023-01-24 11:45:04 +00:00
Martin Geisler
bad5cc9f68
Publish translations to /xx subdirectories (#264)
This publishes translations (currently only the Danish translation) to
subdirectories named after the ISO 639-1 language code: “da/” for
Danish, “ko/” for Korean, etc.

The list of translation is an explicit list to make it easy for us to
enable/disable translations without being tied to the files in po/.
This allows us to experiment with a translation without publishing it
immediately.

I propose that we eventually move the English pages to an “en/”
directory for symmetry with the other locales. However, for now, the
pages remain at the room of our site (which works fine since we don’t
have a subdirectory named “en/” in the course).
2023-01-24 12:07:04 +01:00
Martin Geisler
46f25ac891
Set the site-url to fix 404 page on GitHub Pages (#263)
This fixes the 404 page on GitHub Pages: the default is `/`, but we’re
hosting the site from a subdirectory because of how the repository is
setup.

Fixes #178.
2023-01-24 12:03:46 +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
4444e9a078
Update lifetimes-function-calls.md (#223)
* Update lifetimes-function-calls.md

I am trying to describe the problem lifetimes solve. It may seem they are complex and useless, but the paragraph starts from the problem Rust cannot
solve on it's own (yet). Then the paragraph illustrates the problem represented in the code and how lifetimes solve it.

* Update lifetimes-function-calls.md

Moving the generic explanation of why lifetimes are important to the speaker notes.

* Make language more direct

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-24 09:50:05 +01:00
Igor Petruk
7f178d6212
Update mutex.md (#256)
* Update mutex.md

Adding speaker notes why Rust `Mutex` has its design and mentioning briefly `RwLock`.

Someone from the audience can notice `unwrap()` in the code, it might be worth to have the answer in speaker notes.

* Apply suggestions from code review

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-24 08:43:27 +00:00
Igor Petruk
178d7104e6
Update channels.md (#254)
* Update channels.md

Adding speaker notes explaining why `send` and `recv` can fail.

* Explicitly mention that the channel is closed when the sender/receiver is dropped

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-24 08:35:48 +00:00
Igor Petruk
617f4e2bb7
Update error-contexts.md (#251)
* Update error-contexts.md

Adding more speaker notes about `anyhow`.

* Add markup

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-24 07:33:03 +00:00
Igor Petruk
912f592199
Update copy-clone.md (#221) 2023-01-23 21:26:21 +01: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
Charisee Chiw
a517ff5816
Speaker notes for pattern matching (#260)
* Speaker notes for pattern matching

* Update pattern-matching.md

Co-authored-by: Fabian Bornhofen <fbornhofen@google.com>
2023-01-23 21:22:01 +01:00