1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-24 15:29:28 +02:00

12 Commits

Author SHA1 Message Date
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
Lukasz Anforowicz
f04e277744
Chromium: Add redox_syscall to speaker notes for the third-party exercise. (#1571)
Speaker notes for Chromium's third-party crate exercise list the
transitive dependencies that will be downloaded during the exercise.
Before this commit the list was missing the `redox_syscall` crate.

Additionally, the commit sorts the crates to make it easier to compare
with the output of `git status` or `ls`.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-12-11 07:21:53 -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
Lukasz Anforowicz
8f9902cc3e
Chromium: new subsection about gtest tests (#1551) 2023-12-05 10:39:02 +00: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
02d0b5d01a
Chromium: fix path of String::from_utf16 (#1541) 2023-12-01 09:21:20 +01:00
Adrian Taylor
5cec89045b
Thank creator of uwu crate. (#1505) 2023-11-29 15:38:19 +01: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
Bram Bonné
d39740f91d
Fix link to uwuify crate (#1499) 2023-11-28 13:37:06 +00: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