As I mentioned in #1536:
* Break into segments at approximately the places @fw-immunant put
breaks
* Move all of the files into `src/concurrency`
* Add timings and segment/session metadata so course outlines appear
There's room for more work here, including some additional feedback from
@fw-immunant after the session I observed, but let's do one step at a
time :)
Bumps the patch group in /src/exercises/bare-metal/compass with 1
update: [cortex-m-rt](https://github.com/rust-embedded/cortex-m).
Updates `cortex-m-rt` from 0.7.3 to 0.7.4
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the patch group in /src/exercises/bare-metal/rtc with 2 updates:
[chrono](https://github.com/chronotope/chrono) and
[cc](https://github.com/rust-lang/cc-rs).
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
Updates `cc` from 1.0.91 to 1.0.95
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates `serde` from 1.0.197 to 1.0.198
Updates `serde_json` from 1.0.115 to 1.0.116
Updates `thiserror` from 1.0.58 to 1.0.59
Updates `reqwest` from 0.12.3 to 0.12.4
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The existing `RefCell` example code was more complex than necessary to
demonstrate the functionality, and was complex in a way that I often
found hard to explain to students. This PR replaces it with a much
simpler demonstration, and adds a code example for `Cell`.
I think it'd be helpful to actually demonstrate to students how the
"sharing XOR mutability" rule actually prevents errors in practice,
since right now we explain the rule but don't give much context as to
why the rule is important.
The previous example code for the `Clone` slide was a bit too complex in
a way that obscured the fundamental point. I've replaced it with the
`say_hello` example from the previous slide, but updated to demonstrate
how cloning can address the borrow checker error. I also added a speaker
note to mention that `Clone` performs a deep copy, which might be
different from what students are used to if they come from a language
like Python that does shallow copies by default.
Give students a little more context for the binary tree exercise by
giving them the wrapper methods on `BinaryTree` at the start and
explicitly asking them to implement the methods on `Subtree`. I think
this simplifies the exercise a bit and makes it a bit more focused for
students.
See invitation here:
https://github.com/google/comprehensive-rust/pull/1971#issuecomment-2061199545
Also note that @enes1313 is marked as a code owner, but they are *not* a
collaborator on the repository so the code owner features are
non-functional and this is considered an error by the GH parser.
Obviously there are two possible resolutions to that...
Reverts google/comprehensive-rust#1975
Using `mdbook-pandoc` requires more than just installing the `mdbook`
plugin: it requires
- A whole LaTeX installation
- A Pandoc installation
- Some fonts
This is essentially why the output is configured as optional in
`book.toml`: the assumption is that people won't have `mdbook-pandoc`
installed without the necessary supporting tools.
@henrif75, I assume you added this because you didn't like the warning
`mdbook build` prints:
```
% mdbook build
2024-04-16 10:45:56 [WARN] (mdbook::book): The output.html.curly-quotes field has been renamed to output.html.smart-punctuation.
Use the new name in book.toml to remove this warning.
2024-04-16 10:45:56 [INFO] (mdbook::book): Book building has started
2024-04-16 10:45:57 [INFO] (mdbook::book): Running the exerciser backend
2024-04-16 10:45:57 [INFO] (mdbook::renderer): Invoking the "exerciser" renderer
2024-04-16 10:45:57 [INFO] (mdbook::book): Running the html backend
2024-04-16 10:45:58 [INFO] (mdbook::book): Running the pandoc backend
2024-04-16 10:45:58 [INFO] (mdbook::renderer): Invoking the "pandoc" renderer
2024-04-16 10:45:58 [WARN] (mdbook::renderer): The command `mdbook-pandoc` for backend `pandoc` was not found, but was marked as optional.
```
I don't have the necessary dependencies on my local system and this is
what I get after installing `mdbook-pandoc`:
```
2024-04-16 10:47:30 [INFO] (mdbook::renderer): Invoking the "pandoc" renderer
Unable to run `pandoc -v`: No such file or directory (os error 2)
2024-04-16 10:47:30 [ERROR] (mdbook::renderer): Renderer exited with non-zero return code.
2024-04-16 10:47:30 [ERROR] (mdbook::utils): Error: Rendering failed
2024-04-16 10:47:30 [ERROR] (mdbook::utils): Caused By: The "pandoc" renderer failed
```
This also means that `mdbook serve` doesn't work unless all dependencies
are installed.
As an alternative, we could remove the `output.pandoc` settings from the
`book.toml` file and use a small shell script to add them when needed.
We actually have the same problem for the `mdbook-xgettext` output
format which generates the POT files: we only want to run this
occasionally. This is currently done by overriding `output` from the
command line using the `MDBOOK_OUTPUT` environment variable:
```shell
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot", "granularity": 0}}' \
mdbook build -d po
```
It's a bit ugly and it results in people missing/forgetting some of the
configuration options we want them to use (the `granularity` setting).
So I would like to move this configuration to the `book.toml` file — but
I'm reluctant since I don't think we need to generate POT files on every
build (it takes ~1 second and would slow down `mdbook serve`).
Cc @max-heller in case you have ideas here.
* Add translations for the new extracted messages related to Day 1and
Day 2 chapters;
* Fix numbering in translation of Day 4 titles;
* Use PO file translator comments for notes and reasons why one or
another choice was made, mention alternatives;
* Do not translate type and trait names;
* Rename: Поток управления -> Управляющие конструкции;
* Rename: Перечисления и сопоставление с образцом. -> Деструктуризация;
* Rename: Ссылки -> Заимствование;
* Rename: Висячие ссылки -> Изменяемые ссылки;
* Rename: Вторая половина дня -> После обеда;
* Rename: Поток управления -> `Let` в потоке управления (src: Let
Control Flow);
* Rename: Функции -> Обобщённые функции (src: Generic Functions);
* Rename: Обобщения (generics). -> Обобщённые типажи (src: Generic
Traits);
* Cannot translate `Slices: &[T]` - possible bug
#326
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
1 update: [nrf52833-hal](https://github.com/nrf-rs/nrf-hal).
Updates `nrf52833-hal` from 0.16.1 to 0.17.0
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Walbran <qwandor@google.com>
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
Updates `cc` from 1.0.91 to 1.0.94
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The trait bounds aren't needed on the struct definition, only the impl
block. I think it'd be useful to show the difference here in order to
show students how trait bounds for collection types are usually on the
impl blocks rather than the type itself.
While it's generally better in Rust code to use `String` as the key type
for a `HashMap` than `&str`, for the purposes of our examples having the
extra `to_string` calls makes the example more verbose and confusing for
students. The simple example will work as-is without the `to_string`
calls, so I think it's better to just remove them.
I find that `if let` makes the most sense to use when you don't have an
`else` case, otherwise it's generally clearer to express the same thing
with a `match`. This changes the `if let` example to be (arguably) a bit
more idiomatic and less verbose.
As discovered during #1961, fixed byte offsets tend to break
translations because the translated strings can end up having a
character on the boundary where we slice.
When a PR restores the cache, it will find the most recent cache from
the `main` branch. This cache should be mostly up to date.
We are constantly at the 10 GB limit for our CI caches, so removing the
extra caches from the many PR branches should ensure that we always have
space for the `main` branch caches.
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
Updates `cc` from 1.0.90 to 1.0.91
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
Updates `cc` from 1.0.90 to 1.0.91
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
I made a small mistake during the refactor in #1492: I removed the
`MDBOOK_BOOK__LANGUAGE` environment variable, which means that we ended
up testing the original Rust code snippets again and again.
This commit also fixes the few typos that have sneaked into the
translations due to the lack of testing.
* Build `messages.pot` (untracked) using `gettext` with granularity=0;
* Update `ru.po` with `msgmerge --update`;
* Make it easier to review consequent translation-centric pull requests;
#326