1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-14 14:10:05 +02:00
Commit Graph

1303 Commits

Author SHA1 Message Date
Martin Geisler
692e4b09c8
Update dprint config (#1354)
The new version of the Markdown plugin has the fix for
https://github.com/dprint/dprint-plugin-markdown/issues/87.

Fixes #1308.
2023-10-12 21:30:49 +02:00
Manish Kumar
358d7da22c
Update catch_unwind example (#1356)
Fixes #1352.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-10-12 15:27:45 +00:00
Seth Paydar
de0e8e6b6d
fix: typo in mark_visited fn docstring (#1355)
Fixes a typo in the `mark_visited` function docstring.

See [`HashSet.insert`
documentation](https://doc.rust-lang.org/stable/std/collections/struct.HashSet.html#method.insert)
2023-10-12 09:42:56 +00:00
Noam Zaks
b1cd19ed20
Added action to prevent changing msgid (#1351)
See discussion in #1344.

This checks that all `.po` files changed in pull requests either contain
changes in POT-Creation-Date (i.e. are run by the specific tool which
should change msgid's), or don't change msgid's (by checking that each
line changed is NOT between msgid and msgstr)

I have tested this on my fork, see [valid
changes](https://github.com/noamzaks/comprehensive-rust/pull/1/files)
where the action passes, and [invalid
changes](https://github.com/noamzaks/comprehensive-rust/pull/2/files)
where it doesn't.

The action also has output for failing/passing:

[passing](https://github.com/noamzaks/comprehensive-rust/actions/runs/6488171290/job/17620037473?pr=1)

[failing](https://github.com/noamzaks/comprehensive-rust/actions/runs/6488175171/job/17620050716?pr=2)
2023-10-11 23:31:51 +02:00
Henri F
a46c6c19df
Adds SketchK credit as a zh-CN translator (#1338) 2023-10-11 11:16:24 -05:00
Martin Geisler
98f5f9a88f
Revert "Fix typo: missing n in unknown" (#1347)
Reverts google/comprehensive-rust#1344.

The edit to the Markdown file has been kept since we _do_ want to fix
the typo!
2023-10-11 11:47:04 +00:00
Nick Radcliffe
b398b46a10
Update dining-philosophers-async.rs (#1346)
Also replace Thales with Hypatia in the async version of Dining
Philosophers.
2023-10-11 13:35:08 +02:00
Nick Radcliffe
18f0ebf9dc
Update dining-philosophers.rs (#1345)
Replace Thales with Hypatia for slightly more inclusivity.
2023-10-11 13:34:12 +02:00
Noam Zaks
4eebe43f3b
Fix typo: missing n in unknown (#1344) 2023-10-11 11:30:19 +01:00
Oscar
b037548923
Add mdbook-xgettext skip for untranslatable codeblocks in Bare Metal (#1339)
See #1327

Removes 280 lines from `messages.pot`.

Signed-off-by: 0scvr <71343264+0scvr@users.noreply.github.com>
2023-10-11 09:32:12 +00:00
Henri F
fb3f58f7ef
zh-CN: Restores PO file structure format (#1337)
This will restore the regular structure format of the PO file (line
breaks and wrap) and does not change the content itself. Part of #324
2023-10-11 10:10:57 +08:00
James Abley
2f50e8be84
Update debugging.md gdb command (#1332)
The provided example did not work for me. I got:

`zsh: command not found: gdb-multiarch`

The other version worked instead. This might be a MacOS thing, or an
Apple Silicon thing. The other command is the same as used in
https://docs.rust-embedded.org/book/intro/install/macos.html so maybe
the MacOS installation guidance also needs updating?
2023-10-10 10:32:31 +01:00
Noam Zaks
ee48c4684a
Fix typo: include semi colon in code (#1335) 2023-10-10 08:15:21 +00:00
Martin Geisler
7bffb7f2c4
Update mutable-static-variables.md (#1331)
From a discussion in #1297.
2023-10-09 15:15:26 +02:00
Martin Geisler
65f6dbcd85
Fix and expand Bare-metal Rust entry in glossary (#1325)
The entry lacked the forced line-break of the other entries.
2023-10-09 11:29:14 +02:00
Qinglin
72e2c94398
zh-CN: translate android/interoperability.md (#1225)
Part of #324
2023-10-09 15:31:50 +08:00
Henri F
5ce24aa2de
zh-CN: Solutions Translations (#1321)
Professional translations for missing exercise solutions entries #324.
This is a new attempt, after fixing the original .po file (#1312).

The diff is large mostly because of the normalization.

Co-authored-by: Zhang SIQI <zhangsiqi1988@gmail.com>
2023-10-09 14:29:28 +08:00
Henri F
6949e1b0b8
zh-CN: Day 3 Translations (#1320)
Professional translations for missing day 3 entries #324.
This is a new attempt, after fixing the original .po file (#1312).

The diff is large mostly because of the normalization.

Co-authored-by: Zhang SIQI <zhangsiqi1988@gmail.com>
2023-10-09 14:21:19 +08:00
Henri F
78dfe60bb3
zh-CN: Day 2 Translations (#1319)
Professional translations for missing day 2 entries #324
This is a new attempt, after fixing the original .po file
(https://github.com/google/comprehensive-rust/pull/1312).
The diff is large mostly because of the normalization (line breaks,
etc.)

Co-authored-by: Zhang SIQI <zhangsiqi1988@gmail.com>
2023-10-09 14:10:17 +08:00
Henri F
fdae99c3d2
zh-CN: Day 1 Translations (#1318)
Professional translations for missing day 1 entries #324
2023-10-09 13:58:57 +08:00
JWSong
8b5f3fd238
ko: fix typo (#1326)
fixed a typo
2023-10-08 11:42:41 +00:00
Martin Geisler
ac8e3ed14f
Mention POT-Creation-Date in instructions (#1314)
I don’t know if this is enough on its own? In principle, the new
publication system should work smoothly without people having to know
much about this header, so that’s why I only describe it briefly.

Followup to #1243.
2023-10-07 18:32:10 +02:00
Martin Geisler
1f022e318a
Add more coverage about the course (#1298)
There has now been three articles about the course.
2023-10-06 14:27:31 +02:00
Martin Geisler
a7f7afa4a2
Format the glossary using a Markdown list (#1307)
This format has two advantages:

- is easier to maintain in the Markdown file. Tables cannot be wrapped
in Markdown, which would severely limit what we can write for each term.
- it can be styled better. The layout now looks more like what you find
in a dictionary.

Before:


![image](https://github.com/google/comprehensive-rust/assets/89623/26bdc39e-4c1d-4f33-90d5-a1637712bcb8)

After:


![image](https://github.com/google/comprehensive-rust/assets/89623/38c1b329-4a80-4771-b415-425a537a0388)


Followup to #1277.
2023-10-06 14:26:52 +02:00
Hidenori Kobayashi
8ff97f1ee7
Remove HTML tag <abbr> (#1310)
The html tag seems to confuse the mdbook-i18n-helpers and make the
translation work hard (#1284).

This simply replaces them with a set of parenthesis.
2023-10-06 10:38:48 +01:00
Henri F
fa1f19e391
zh-CN: Restores lost translations (#1312)
Addresses issue #1311

zh-CN.po stats:
```
msgfmt -o /dev/null --statistics po/zh-CN.po
1258 translated messages, 178 fuzzy translations, 1038 untranslated messages.
```
2023-10-06 08:02:48 +00:00
Zhang SIQI
1a0c0d3fa6
Update CODEOWNERS (#1309)
@henrif75 I want to add myself as the Chinese version reviewer! 
Thank you
2023-10-06 09:56:26 +02:00
Martin Geisler
a38a33c8fb
Use AND between words in mdbook search (#1306)
The default is to use `OR`, which I find counter-intuitive: the more I
try to narrow down a search, the more hits I get. See the full
documentation for more options:


https://rust-lang.github.io/mdBook/format/configuration/renderers.html#outputhtmlsearch
2023-10-05 10:17:05 -04:00
Nick Radcliffe
c93a4bc20c
Remove unused import (use) (#1303)
This should be a clean pull request with just the required diff
2023-10-05 11:17:48 +02:00
Nick Radcliffe
2072ed022b
Fix typo (missing s on threads) (#1304)
Again, a clean pull request for this typo.
2023-10-05 09:17:17 +00:00
Martin Geisler
5760e99e22
Introduce a glossary (#1277)
The goal of this is twofold: give translators a place to document how
certain terms are translated as well as giving people a place to quickly
find a definition of a term. The slides might not always give a quick
definition the same way a glossary can.
2023-10-05 07:17:24 +02:00
Kanta Yamaoka (山岡幹太)
d59cb116b7
ja: Translate Chapter 24 (Generics) (#1283)
Hi JP translation folks (#652). Here's a MR for Generics chapter. Could
you take a look at it? Thank you!
2023-10-05 07:58:20 +09:00
Colin Finck
9d45db83b1
Add a "minimum wrong example" program in C (#1241)
This example shows what kind of bugs easily slip into C code and are
made impossible via Rust.

I have created this example for the motivation slides of my master
thesis. Since then, the university institute has used it in their
introduction to Rust.
I hereby make this part available to the Comprehensive Rust course and
relicense it under the terms of the Apache 2.0 license.

Thank you @mgeisler for your invitation to contribute to this course!

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-10-04 13:26:37 +00:00
Martin Geisler
8c2d8208b2
Link blog post from README.md (#1291)
I hope the blog post can help shed more light on why we wrote the course
and how it has been used at Google.

I'm not sure if "Press" is the best title, but I hope to link other
articles later from this section at a later point.
2023-10-04 13:01:02 +02:00
Martin Geisler
7395725edf
Avoid naming struct field like trait method (#1294)
The `name` struct field was confusing because it was named the same as
the trait method. The struct fields are now disjoint from the method
names — the fact that there are two separate name spaces is not the
point of these slides.

I also dropped the zero-sized type, this is also not the main focus
here.

I also compressed the code a bit to make the unimportant structs take
up less space.

Fixes #1292.
2023-10-04 09:52:15 +00:00
Nick Radcliffe
a883a569d0
Remove unused callback from GUI exercise (#1293)
Here's a possible update to the GUI/TUI exercise, taking out the
callback and explaining (slightly).

See what you think.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-10-03 14:07:33 +00:00
Nick Radcliffe
0f768df367
Minor rewording of safe-ffi-wrapper exercise. (#1286)
For readability.
2023-10-03 14:03:30 +00:00
Martin Geisler
9f079f173b
Update all Cargo.lock files (#1295)
This is the result of running `cargo update` in every directory.

It fixes a alert: https://github.com/advisories/GHSA-9mcr-873m-xcxp. We
don’t run any HTTP server directly, so this is not super important for
us. However, it will remove the alert from my dashboard.
2023-10-03 14:18:44 +02:00
Yuri Astrakhan
36449cb1b2
Add hash to rustdoc example (#1282)
Hashes are important (and somewhat confusing to novices) part of the
rustdoc.
2023-10-02 14:23:46 +02:00
Martin Geisler
1d658ead10
Update to mdbook-i18n-helpers 0.2.4 (#1263)
This is the newest release of mdbook-i18n-helpers, fully backwards
compatible with the old one.
2023-10-01 23:01:22 -07:00
Martin Geisler
42541fc401
Automatically format YAML, CSS, and JS files (#1272)
Initially, I also formatted the templates in `theme/`, but this triggers
https://github.com/prettier/prettier/issues/11834. So I exclude them for
now.

---------

Co-authored-by: Ming-Ying Chung <mych@chromium.org>
2023-10-02 14:48:00 +09:00
Alexey Sokolov
4e768e2e36
Fix several typos (#1251)
cc @Makarevich
2023-09-29 11:41:48 -07:00
Henri Fontana
86cde61f60
zh_CN: .po refresh and remaining course intro translations (#1242)
Normalizes .po file and add professional translation to missing entries
before day 1.
#324
2023-09-29 11:38:31 -07:00
Yarema Mazuryk
1a1a9c85db
continued translation - finished 1-200, continued with 201-400 (#1278)
part of #836
2023-09-29 12:25:52 +01:00
Yuri Astrakhan
c894ea3517
Add unittest example to rustdoc (#1276)
Fixes #1275

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-09-29 06:40:24 +00:00
Matthew
1c43db108b
Fix inconsistent filename styling (#1274)
Addresses https://github.com/google/comprehensive-rust/issues/625

Pages with inconsistent styling:
[Bare Metal Rust Afternoon
Solutions](https://google.github.io/comprehensive-rust/exercises/bare-metal/solutions-afternoon.html)
[Concurrency Afternoon
Solutions](https://google.github.io/comprehensive-rust/exercises/concurrency/solutions-afternoon.html)
[Microcontroller > Debugging
Page](https://google.github.io/comprehensive-rust/bare-metal/microcontrollers/debugging.html)
2023-09-29 08:38:42 +02:00
Martin Geisler
81e30daf66
Run dprint config update (#1273)
This updates the plugins to the latest version.
2023-09-28 22:52:00 +02:00
Dustin J. Mitchell
0e89050eb9
Actually print something in prime_squares example (#1271)
As suggested in #1268.
2023-09-28 11:09:40 +02:00
Martin Geisler
c74b2c8a04
da: Translate the welcome page (#1256) 2023-09-27 12:57:48 +00:00
Martin Geisler
d0e0e5c1af
Skip some untranslatable code blocks (#1258)
This builds on the work of @dyoo in
https://github.com/google/mdbook-i18n-helpers/pull/69: by adding a
special `<!-- mdbook-xgettext: skip -->` comment, we can skip the
following code block.

I also modified a few code blocks to remove translatable text: variable
names are not expected to be translated, so it’s fine to have a line
with `println!("foo: {foo}")` in the code block.

This PR removes 36 messages from the POT file. The number of lines drop
by 633 (3%).

Part of #1257.
2023-09-26 17:04:46 +02:00