1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-02 15:47:25 +02:00

21 Commits

Author SHA1 Message Date
Adrian Taylor
3afdabf391
Update cargo.md to fix typos (#1848) 2024-02-23 11:18:04 -08:00
Martin Geisler
099ca497f2
Fix typo in cargo.md (#1847) 2024-02-23 14:15:58 +00:00
Martin Geisler
c9f66fd425
Format all Markdown files with dprint (#1157)
This is the result of running `dprint fmt` after removing `src/` from
the list of excluded directories.

This also reformats the Rust code: we might want to tweak this a bit in
the future since some of the changes removes the hand-formatting. Of
course, this formatting can be seen as a mis-feature, so maybe this is
good overall.

Thanks to mdbook-i18n-helpers 0.2, the POT file is nearly unchanged
after this, meaning that all existing translations remain valid! A few
messages were changed because of stray whitespace characters:

     msgid ""
     "Slices always borrow from another object. In this example, `a` has to remain "
    -"'alive' (in scope) for at least as long as our slice. "
    +"'alive' (in scope) for at least as long as our slice."
     msgstr ""

The formatting is enforced in CI and we will have to see how annoying
this is in practice for the many contributors. If it becomes annoying,
we should look into fixing dprint/check#11 so that `dprint` can annotate
the lines that need fixing directly, then I think we can consider more
strict formatting checks.

I added more customization to `rustfmt.toml`. This is to better emulate
the dense style used in the course:

- `max_width = 85` allows lines to take up the full width available in
our code blocks (when taking margins and the line numbers into account).
- `wrap_comments = true` ensures that we don't show very long comments
in the code examples. I edited some comments to shorten them and avoid
unnecessary line breaks — please trim other unnecessarily long comments
when you see them! Remember we're writing code for slides 😄
- `use_small_heuristics = "Max"` allows for things like struct literals
and if-statements to take up the full line width configured above.

The formatting settings apply to all our Rust code right now — I think
we could improve this with https://github.com/dprint/dprint/issues/711
which lets us add per-directory `dprint` configuration files. However,
the `inherit: true` setting is not yet implemented (as far as I can
tell), so a nested configuration file will have to copy most or all of
the top-level file.
2023-12-31 00:15:07 +01:00
Lukasz Anforowicz
dea36b76cf
Chromium: Add a section about the chromium::import! macro. (#1611) 2023-12-22 07:50:11 -08:00
Pavel Roskin
30f8e50b43
Fix typos (#1608) 2023-12-20 18:21:54 +00:00
Adrian Taylor
4a576fd436
Update depending-on-a-crate.md (#1570)
Fix typo
2023-12-08 07:07:13 -08:00
Lukasz Anforowicz
89b41555eb
Title-casing in section titles (#1557)
Fixes https://github.com/google/comprehensive-rust/issues/1552
2023-12-07 18:06:18 -08:00
Adrian Taylor
cc8405d04f
Chromium exercise solutions (#1564)
The main thing in this CL is a link to exercise solutions but there are
a couple of other very minor tweaks.
2023-12-06 19:26:41 +00:00
Adrian Taylor
59a0faba83
Update policy.md (#1560)
Fix formatting of "C++"
2023-12-06 09:55:42 -05:00
Lukasz Anforowicz
8f9902cc3e
Chromium: new subsection about gtest tests (#1551) 2023-12-05 10:39:02 +00:00
Lukasz Anforowicz
24b132b67a
Chromium: expanding CXX error handling section. (#1539) 2023-12-04 08:03:17 -08:00
Lukasz Anforowicz
584c957d69
Fix spelling of CXX and Cargo (mostly in the Chromium part). (#1549) 2023-12-01 10:21:47 -08:00
Lukasz Anforowicz
1ab68d6ac1
Chromium: minor tweaks in reviews-and-audits.md. (#1540) 2023-12-01 09:34:04 +01:00
Lukasz Anforowicz
547de2b161
Chromium: Expand speaker notes for Rust Analyzer demo (#1537) 2023-12-01 09:25:29 +01:00
Lukasz Anforowicz
f3e045ddf4
Chromium: Enumerate automation benefits of cxx + other minor tweaks. (#1524) 2023-12-01 09:24:59 +01:00
Lukasz Anforowicz
c7fb26fe0e
Chromium: Revise cargo.md, focusing on when to prefer cargo over gn. (#1520) 2023-12-01 09:23:58 +01:00
Martin Geisler
97e130271d
Fix Markdown in build-rules.md (#1530)
The mixing of HTML and Markdown breaks our translation pipeline: we see
the HTML and fail to parse things correctly.

This might be https://github.com/google/mdbook-i18n-helpers/issues/97,
but I'm not 100% sure.

The fix is to make put the HTML on its own line: then the Markdown is
parsed again inside.

Fixes #1527.
2023-11-30 06:55:03 -08:00
Adrian Taylor
ea204774b6
Bring Chromium patching instructions up to date. (#1508)
Patching is now automatic.
2023-11-29 15:41:52 +01:00
Adrian Taylor
1feda6f267
Add speaker notes for cargo comparison. (#1498)
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-11-28 20:36:24 +00:00
Martin Geisler
aebb0bc856
Replace hyphens (-) with em-dashes () (#1500)
The new Chromium class likes — like me! — to use dashes in the writing!
However, I believe it should use an em-dash instead of the hyphen.

Luckily this is easy: we have enabled “typographic quotes” in `mdbook`,
which also handles the conversion of `---` to `—` in the generated HTML.
So I normalized the single existing em-dash to a triple-dash to make it
more consistent (and hopefully make it easier for translators to
consistently enter these characters).
2023-11-28 19:41:09 +01:00
Adrian Taylor
7f469fb2c7
Add Chromium section (#1479)
This is a contribution of a Chromium section for Comprehensive Rust.

---------

Co-authored-by: Nicole L <dlegare.1001@gmail.com>
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-11-27 18:21:19 +00:00